harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r405031 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java: java/net/ org/apache/harmony/luni/internal/net/www/protocol/ftp/ org/apache/harmony/luni/net/ org/apache/harmony/luni/util/
Date Mon, 08 May 2006 12:16:26 GMT
Author: tellison
Date: Mon May  8 05:16:23 2006
New Revision: 405031

URL: http://svn.apache.org/viewcvs?rev=405031&view=rev
Log:
- Some generics uplift
- Externalize messages

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetAddress.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/NetUtil.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/ExternalMessages.properties

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetAddress.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetAddress.java?rev=405031&r1=405030&r2=405031&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetAddress.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/InetAddress.java
Mon May  8 05:16:23 2006
@@ -937,8 +937,8 @@
 
 			StringTokenizer tokenizer = new StringTokenizer(ipAddressString,
 					":.%", true);
-			ArrayList hexStrings = new ArrayList();
-			ArrayList decStrings = new ArrayList();
+			ArrayList<String> hexStrings = new ArrayList<String>();
+			ArrayList<String> decStrings = new ArrayList<String>();
 			String scopeString = null;
 			String token = "";
 			String prevToken = "";

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java?rev=405031&r1=405030&r2=405031&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
Mon May  8 05:16:23 2006
@@ -19,6 +19,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.harmony.luni.util.Msg;
 import org.apache.harmony.luni.util.PriviAction;
 
 /*
@@ -49,7 +50,8 @@
 	 */
 	public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
 		if (null == uri || null == sa || null == ioe) {
-			throw new IllegalArgumentException("null argument is not allowed");
+            // "KA001=Argument must not be null"
+			throw new IllegalArgumentException(Msg.getString("KA001")); //$NON-NLS-1$
 		}
 	}
 
@@ -61,7 +63,8 @@
 	public List select(URI uri) {
 		// argument check
 		if (null == uri) {
-			throw new IllegalArgumentException("null argument is not allowed");
+            // "KA001=Argument must not be null"
+            throw new IllegalArgumentException(Msg.getString("KA001")); //$NON-NLS-1$
 		}
 		// check scheme
 		String scheme = uri.getScheme();
@@ -85,7 +88,7 @@
 		} else if ("socket".equals(scheme)) { //$NON-NLS-1$
 			proxy = selectSocksProxy();
 		}
-		List proxyList = new ArrayList(1);
+		List<Proxy> proxyList = new ArrayList<Proxy>(1);
 		proxyList.add(proxy);
 		return proxyList;
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java?rev=405031&r1=405030&r2=405031&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
Mon May  8 05:16:23 2006
@@ -160,9 +160,9 @@
 	public void connect() throws IOException {
 		// Use system-wide ProxySelect to select proxy list,
 		// then try to connect via elements in the proxy list.
-		List proxyList = null;
+		List<Proxy> proxyList = null;
 		if(null != proxy){
-			proxyList = new ArrayList(1);
+			proxyList = new ArrayList<Proxy>(1);
 			proxyList.add(proxy);
 		}else{
 			proxyList = NetUtil.getProxyList(uri);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/NetUtil.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/NetUtil.java?rev=405031&r1=405030&r2=405031&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/NetUtil.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/NetUtil.java
Mon May  8 05:16:23 2006
@@ -47,11 +47,11 @@
     		return true;
     	}
         String proxySet = (String) AccessController
-                .doPrivileged(new PriviAction("socksProxySet"));
+                .doPrivileged(new PriviAction("socksProxySet")); //$NON-NLS-1$
         if (proxySet != null) {
-            return proxySet.toLowerCase().equals("true");
+            return proxySet.toLowerCase().equals("true"); //$NON-NLS-1$
         }
-        return AccessController.doPrivileged(new PriviAction("socksProxyHost")) != null;
+        return AccessController.doPrivileged(new PriviAction("socksProxyHost")) != null;
//$NON-NLS-1$
     }
 
     /**
@@ -61,8 +61,8 @@
      */
     public static boolean preferIPv6Addresses() {
     	String result = (String) AccessController.doPrivileged(new PriviAction(
-    			"java.net.preferIPv6Addresses"));
-    	return "true".equals(result);
+    			"java.net.preferIPv6Addresses")); //$NON-NLS-1$
+    	return "true".equals(result); //$NON-NLS-1$
     }
 
     /**
@@ -72,8 +72,8 @@
      */
     public static boolean preferIPv4Stack() {
     	String result = (String) AccessController.doPrivileged(new PriviAction(
-    			"java.net.preferIPv4Stack"));
-        return "true".equals(result);
+    			"java.net.preferIPv4Stack")); //$NON-NLS-1$
+        return "true".equals(result); //$NON-NLS-1$
     }
 
     /**
@@ -82,7 +82,7 @@
      * @return a list of proxy for the uri. Returns null if no proxy 
      * 		   is available.
      */
-    public static List getProxyList(URI uri){
+    public static List<Proxy> getProxyList(URI uri){
 		// use system default selector to get proxy list
 		ProxySelector selector = ProxySelector.getDefault();
 		if(null == selector){
@@ -91,5 +91,4 @@
 		List proxyList = selector.select(uri);
     	return proxyList;
     }
-
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/ExternalMessages.properties
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/ExternalMessages.properties?rev=405031&r1=405030&r2=405031&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/ExternalMessages.properties
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/ExternalMessages.properties
Mon May  8 05:16:23 2006
@@ -276,13 +276,13 @@
 K0342=Scheme expected
 K0344=Not a valid {0}, subclass should override readResolve()
 K0346=Unmatched braces in the pattern
-KA000=Line too long
 K0347=seek position is negative
 K0348=Format specifier '{0}'
 K0349=Conversion is '{0}'
 K034a=The flags are {0}
 K034b=url and proxy can not be null
-K034c=proxy should not be be null
+K034c=proxy should not be null
 K034d=method has not been implemented yet
 K034e=Build rules empty
-
+KA000=Line too long
+KA001=Argument must not be null
\ No newline at end of file



Mime
View raw message