You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2010/02/11 22:25:41 UTC
svn commit: r909153 - in
/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal:
SocketChannelImpl.java nls/messages.properties
Author: hindessm
Date: Thu Feb 11 21:25:39 2010
New Revision: 909153
URL: http://svn.apache.org/viewvc?rev=909153&view=rev
Log:
Refactor nls message handling to remove dependency on old luni classes.
Modified:
harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java
harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/nls/messages.properties
Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java?rev=909153&r1=909152&r2=909153&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java Thu Feb 11 21:25:39 2010
@@ -47,7 +47,7 @@
import org.apache.harmony.luni.platform.INetworkSystem;
import org.apache.harmony.luni.platform.Platform;
import org.apache.harmony.luni.util.ErrorCodeException;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.nio.internal.nls.Messages;
import org.apache.harmony.nio.AddressUtil;
import org.apache.harmony.nio.internal.nls.Messages;
@@ -910,7 +910,7 @@
throws SocketException {
checkOpen();
if (size < 1) {
- throw new IllegalArgumentException(Msg.getString("K0035")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("nio.0E")); //$NON-NLS-1$
}
socketImpl
.setOption(SocketOptions.SO_RCVBUF, Integer.valueOf(size));
@@ -927,7 +927,7 @@
public synchronized void setSendBufferSize(int size) throws SocketException {
checkOpen();
if (size < 1) {
- throw new IllegalArgumentException(Msg.getString("K0035")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("nio.0E")); //$NON-NLS-1$
}
socketImpl.setOption(SocketOptions.SO_SNDBUF, Integer.valueOf(size));
}
@@ -936,7 +936,7 @@
public void setSoLinger(boolean on, int timeout) throws SocketException {
checkOpen();
if (on && timeout < 0) {
- throw new IllegalArgumentException(Msg.getString("K0045")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("nio.0F")); //$NON-NLS-1$
}
int val = on ? (65535 < timeout ? 65535 : timeout) : -1;
socketImpl.setOption(SocketOptions.SO_LINGER, Integer.valueOf(val));
@@ -946,7 +946,7 @@
public synchronized void setSoTimeout(int timeout) throws SocketException {
checkOpen();
if (timeout < 0) {
- throw new IllegalArgumentException(Msg.getString("K0036")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("nio.10")); //$NON-NLS-1$
}
socketImpl.setOption(SocketOptions.SO_TIMEOUT, Integer.valueOf(timeout));
}
Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/nls/messages.properties?rev=909153&r1=909152&r2=909153&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/nls/messages.properties (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/nls/messages.properties Thu Feb 11 21:25:39 2010
@@ -28,3 +28,6 @@
nio.0B=New position must be non-negative.
nio.0C=Offset out of bounds \: {0}
nio.0D=Length out of bounds \: {0}
+nio.0E=Zero or negative buffer size
+nio.0F=Attempted to set a negative SoLinger
+nio.10=Invalid negative timeout