harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r909389 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni: internal/nls/messages.properties net/PlainSocketImpl.java net/SocketInputStream.java net/SocketOutputStream.java net/Socks4Message.java
Date Fri, 12 Feb 2010 13:01:10 GMT
Author: hindessm
Date: Fri Feb 12 13:01:09 2010
New Revision: 909389

URL: http://svn.apache.org/viewvc?rev=909389&view=rev
Log:
Refactor nls messages to use new message mechanism.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties?rev=909389&r1=909388&r2=909389&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/nls/messages.properties
Fri Feb 12 13:01:09 2010
@@ -26,3 +26,15 @@
 luni.09=Invalid Unicode sequence: illegal character
 luni.0A=Index: {0}, Size: {1}
 luni.0B=Array index out of range: {0}
+luni.0C=Socket is closed
+luni.0D=SOCKS connection failed\: {0}
+luni.0E=Unable to connect to SOCKS server\: {0}
+luni.0F=Invalid SOCKS client.
+luni.10=Malformed reply from SOCKS server
+luni.11=buffer is null
+luni.12=Offset out of bounds \: {0}
+luni.13=Arguments out of bounds
+luni.14=Failure to connect to SOCKS server.
+luni.15=Unable to connect to identd to verify user.
+luni.16=Failure - user ids do not match.
+luni.17=Success

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java?rev=909389&r1=909388&r2=909389&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
Fri Feb 12 13:01:09 2010
@@ -38,7 +38,7 @@
 
 import org.apache.harmony.luni.platform.INetworkSystem;
 import org.apache.harmony.luni.platform.Platform;
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * A concrete connected-socket implementation.
@@ -271,7 +271,7 @@
     @Override
     protected synchronized InputStream getInputStream() throws IOException {
         if (!fd.valid()) {
-            throw new SocketException(Msg.getString("K003d"));
+            throw new SocketException(Messages.getString("luni.0C"));
         }
 
         return new SocketInputStream(this);
@@ -298,7 +298,7 @@
     @Override
     protected synchronized OutputStream getOutputStream() throws IOException {
         if (!fd.valid()) {
-            throw new SocketException(Msg.getString("K003d")); //$NON-NLS-1$
+            throw new SocketException(Messages.getString("luni.0C")); //$NON-NLS-1$
         }
         return new SocketOutputStream(this);
     }
@@ -394,7 +394,7 @@
             }
 
         } catch (Exception e) {
-            throw new SocketException(Msg.getString("K003e", e)); //$NON-NLS-1$
+            throw new SocketException(Messages.getString("luni.0D", e)); //$NON-NLS-1$
         }
 
         socksRequestConnection(applicationServerAddress, applicationServerPort);
@@ -454,13 +454,13 @@
             netImpl.connect(fd, trafficClass, socksGetServerAddress(),
                     socksGetServerPort());
         } catch (Exception e) {
-            throw new IOException(Msg.getString("K003f", e)); //$NON-NLS-1$
+            throw new IOException(Messages.getString("luni.0E", e)); //$NON-NLS-1$
         }
 
         // There must be a connection to an application host for the bind to
         // work.
         if (lastConnectedAddress == null) {
-            throw new SocketException(Msg.getString("K0040")); //$NON-NLS-1$
+            throw new SocketException(Messages.getString("luni.0F")); //$NON-NLS-1$
         }
 
         // Use the last connected address and port in the bind request.
@@ -517,7 +517,7 @@
             bytesRead += count;
         }
         if (Socks4Message.REPLY_LENGTH != bytesRead) {
-            throw new SocketException(Msg.getString("KA011")); //$NON-NLS-1$
+            throw new SocketException(Messages.getString("luni.10")); //$NON-NLS-1$
         }
         return reply;
     }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java?rev=909389&r1=909388&r2=909389&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
Fri Feb 12 13:01:09 2010
@@ -22,7 +22,7 @@
 import java.net.Socket;
 import java.net.SocketImpl;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 /**
  * The SocketInputStream supports the streamed reading of bytes from a socket.
@@ -70,7 +70,7 @@
     @Override
     public int read(byte[] buffer, int offset, int count) throws IOException {
         if (null == buffer) {
-            throw new IOException(Msg.getString("K0047"));//$NON-NLS-1$
+            throw new IOException(Messages.getString("luni.11"));//$NON-NLS-1$
         }
 
         if (0 == count) {
@@ -79,10 +79,10 @@
 
         if (0 > offset || offset >= buffer.length) {
             // K002e=Offset out of bounds \: {0}
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002e", offset));//$NON-NLS-1$
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.12", offset));//$NON-NLS-1$
         }
         if (0 > count || offset + count > buffer.length) {
-            throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f"));//$NON-NLS-1$
+            throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.13"));//$NON-NLS-1$
         }
 
         return socket.read(buffer, offset, count);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java?rev=909389&r1=909388&r2=909389&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java
Fri Feb 12 13:01:09 2010
@@ -22,7 +22,7 @@
 import java.net.Socket;
 import java.net.SocketImpl;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 class SocketOutputStream extends OutputStream {
 
@@ -58,10 +58,10 @@
                     && count <= buffer.length - offset) {
                 socket.write(buffer, offset, count);
             } else {
-                throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f"));//$NON-NLS-1$
+                throw new ArrayIndexOutOfBoundsException(Messages.getString("luni.13"));//$NON-NLS-1$
             }
         } else {
-            throw new NullPointerException(Msg.getString("K0047"));//$NON-NLS-1$
+            throw new NullPointerException(Messages.getString("luni.11"));//$NON-NLS-1$
         }
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java?rev=909389&r1=909388&r2=909389&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java
Fri Feb 12 13:01:09 2010
@@ -19,7 +19,7 @@
 
 import java.io.UnsupportedEncodingException;
 
-import org.apache.harmony.luni.util.Msg;
+import org.apache.harmony.luni.internal.nls.Messages;
 
 class Socks4Message {
     static final int COMMAND_CONNECT = 1;
@@ -162,13 +162,13 @@
     public String getErrorString(int error) {
         switch (error) {
             case RETURN_FAILURE:
-                return Msg.getString("K00cd"); //$NON-NLS-1$
+                return Messages.getString("luni.14"); //$NON-NLS-1$
             case RETURN_CANNOT_CONNECT_TO_IDENTD:
-                return Msg.getString("K00ce"); //$NON-NLS-1$
+                return Messages.getString("luni.15"); //$NON-NLS-1$
             case RETURN_DIFFERENT_USER_IDS:
-                return Msg.getString("K00cf"); //$NON-NLS-1$
+                return Messages.getString("luni.16"); //$NON-NLS-1$
             default:
-                return Msg.getString("K00d0"); //$NON-NLS-1$
+                return Messages.getString("luni.17"); //$NON-NLS-1$
         }
     }
 



Mime
View raw message