harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r405112 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java: java/net/ java/util/ org/apache/harmony/luni/internal/net/www/ org/apache/harmony/luni/internal/net/www/protocol/http/ org/apache/harmony/luni/internal/net/...
Date Mon, 08 May 2006 18:04:10 GMT
Author: tellison
Date: Mon May  8 11:04:08 2006
New Revision: 405112

URL: http://svn.apache.org/viewcvs?rev=405112&view=rev
Log:
Reducing compiler warnings
 - Defining missing SUIDs
 - Generic uplifts

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/BindException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ConnectException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/DatagramSocketImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MalformedURLException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NegativeCache.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NoRouteToHostException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/PortUnreachableException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProtocolException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermissionCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketTimeoutException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URISyntaxException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownHostException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownServiceException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Currency.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/MimeTable.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Header.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyClassFile.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/AbstractMemorySpy.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Inet6Util.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/InvalidJarIndexException.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/MsgHelp.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/BindException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/BindException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/BindException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/BindException.java Mon May  8 11:04:08 2006
@@ -22,7 +22,9 @@
  */
 public class BindException extends SocketException {
 
-	/**
+    private static final long serialVersionUID = -5945005768251722951L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public BindException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ConnectException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ConnectException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ConnectException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ConnectException.java Mon May  8 11:04:08 2006
@@ -22,7 +22,9 @@
  */
 public class ConnectException extends SocketException {
 
-	/**
+    private static final long serialVersionUID = 3831404271622369215L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public ConnectException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/DatagramSocketImpl.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/DatagramSocketImpl.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/DatagramSocketImpl.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/DatagramSocketImpl.java Mon May  8 11:04:08 2006
@@ -20,7 +20,6 @@
 import java.io.IOException;
 
 import org.apache.harmony.luni.net.NetUtil;
-import org.apache.harmony.luni.platform.INetworkSystem;
 import org.apache.harmony.luni.platform.Platform;
 
 /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MalformedURLException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MalformedURLException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MalformedURLException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MalformedURLException.java Mon May  8 11:04:08 2006
@@ -27,7 +27,9 @@
  */
 public class MalformedURLException extends IOException {
 
-	/**
+    private static final long serialVersionUID = -182787522200415866L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public MalformedURLException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NegativeCache.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NegativeCache.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NegativeCache.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NegativeCache.java Mon May  8 11:04:08 2006
@@ -27,7 +27,9 @@
  */
 class NegativeCache extends LinkedHashMap {
 
-	static NegativeCache negCache = null;
+    private static final long serialVersionUID = 1L;
+
+    static NegativeCache negCache = null;
 
 	// maximum number of entries in the cache
 	static final int MAX_NEGATIVE_ENTRIES = 5;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NoRouteToHostException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NoRouteToHostException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NoRouteToHostException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NoRouteToHostException.java Mon May  8 11:04:08 2006
@@ -23,7 +23,9 @@
  */
 public class NoRouteToHostException extends SocketException {
 
-	/**
+    private static final long serialVersionUID = -1897550894873493790L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public NoRouteToHostException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/PortUnreachableException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/PortUnreachableException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/PortUnreachableException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/PortUnreachableException.java Mon May  8 11:04:08 2006
@@ -18,7 +18,9 @@
 
 public class PortUnreachableException extends SocketException {
 
-	/**
+    private static final long serialVersionUID = 8462541992376507323L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public PortUnreachableException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProtocolException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProtocolException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProtocolException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProtocolException.java Mon May  8 11:04:08 2006
@@ -25,7 +25,9 @@
  */
 public class ProtocolException extends java.io.IOException {
 
-	/**
+    private static final long serialVersionUID = -6098449442062388080L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public ProtocolException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketException.java Mon May  8 11:04:08 2006
@@ -24,7 +24,9 @@
  */
 public class SocketException extends IOException {
 
-	/**
+    private static final long serialVersionUID = -5935874303556886934L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public SocketException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermissionCollection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermissionCollection.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermissionCollection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermissionCollection.java Mon May  8 11:04:08 2006
@@ -18,6 +18,7 @@
 
 import java.security.Permission;
 import java.security.PermissionCollection;
+import java.util.Enumeration;
 import java.util.Vector;
 
 /**
@@ -46,7 +47,7 @@
 	}
 
 	// Answers an enumeration of the permissions
-	public java.util.Enumeration elements() {
+	public Enumeration<Permission> elements() {
 		return permissions.elements();
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketTimeoutException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketTimeoutException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketTimeoutException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketTimeoutException.java Mon May  8 11:04:08 2006
@@ -20,7 +20,9 @@
 
 public class SocketTimeoutException extends InterruptedIOException {
 
-	/**
+    private static final long serialVersionUID = -8846654841826352300L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public SocketTimeoutException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URISyntaxException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URISyntaxException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URISyntaxException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URISyntaxException.java Mon May  8 11:04:08 2006
@@ -23,7 +23,9 @@
  */
 public class URISyntaxException extends Exception {
 
-	private String input;
+    private static final long serialVersionUID = 2137979680897488891L;
+
+    private String input;
 
 	private int index;
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URL.java Mon May  8 11:04:08 2006
@@ -35,7 +35,7 @@
 	private static final long serialVersionUID = -7627629688361524110L;
 
 	private static final NetPermission specifyStreamHandlerPermission = new NetPermission(
-			"specifyStreamHandler");
+			"specifyStreamHandler"); //$NON-NLS-1$
 
 	private int hashCode;
 
@@ -105,7 +105,8 @@
 	/**
 	 * Cache for storing protocol handler
 	 */
-	private static Hashtable streamHandlers = new Hashtable();
+	private static Hashtable<String,URLStreamHandler> streamHandlers =
+        new Hashtable<String,URLStreamHandler>();
 
 	/**
 	 * The URL Stream (protocol) Handler
@@ -131,7 +132,7 @@
 	public static synchronized void setURLStreamHandlerFactory(
 			URLStreamHandlerFactory streamFactory) {
 		if (streamHandlerFactory != null)
-			throw new Error(org.apache.harmony.luni.util.Msg.getString("K004b"));
+			throw new Error(Msg.getString("K004b")); //$NON-NLS-1$
 		SecurityManager sm = System.getSecurityManager();
 		if (sm != null)
 			sm.checkSetFactory();
@@ -268,7 +269,7 @@
 			// by the values in the spec.
 			if (context != null && protocol.equals(context.getProtocol())) {
 				String cPath = context.getPath();
-				if (cPath != null && cPath.startsWith("/")) {
+				if (cPath != null && cPath.startsWith("/")) { //$NON-NLS-1$
 					set(protocol, context.getHost(), context.getPort(), context
 							.getAuthority(), context.getUserInfo(), cPath,
 							context.getQuery(), null);
@@ -283,7 +284,7 @@
 			// by the values in the ("relative") spec.
 			if (context == null)
 				throw new MalformedURLException(org.apache.harmony.luni.util.Msg.getString(
-						"K00d8", spec));
+						"K00d8", spec)); //$NON-NLS-1$
 			set(context.getProtocol(), context.getHost(), context.getPort(),
 					context.getAuthority(), context.getUserInfo(), context
 							.getPath(), context.getQuery(), null);
@@ -297,7 +298,7 @@
 			setupStreamHandler();
 			if (strmHandler == null)
 				throw new MalformedURLException(org.apache.harmony.luni.util.Msg.getString(
-						"K00b3", protocol));
+						"K00b3", protocol)); //$NON-NLS-1$
 		}
 
 		// Let the handler parse the URL. If the handler throws
@@ -383,8 +384,8 @@
 			throw new MalformedURLException(org.apache.harmony.luni.util.Msg.getString(
 					"K0325", port)); //$NON-NLS-1$
 
-		if (host != null && host.indexOf(":") != -1 && host.charAt(0) != '[') {
-			host = "[" + host + "]";
+		if (host != null && host.indexOf(":") != -1 && host.charAt(0) != '[') { //$NON-NLS-1$
+			host = "[" + host + "]"; //$NON-NLS-1$ //$NON-NLS-2$
 		}
 
 		this.protocol = protocol;
@@ -394,7 +395,7 @@
 		// Set the fields from the arguments. Handle the case where the
 		// passed in "file" includes both a file and a ref part.
 		int index = -1;
-		index = file.indexOf("#", file.lastIndexOf("/"));
+		index = file.indexOf("#", file.lastIndexOf("/")); //$NON-NLS-1$ //$NON-NLS-2$
 		if (index >= 0) {
 			this.file = file.substring(0, index);
 			ref = file.substring(index + 1);
@@ -410,7 +411,7 @@
 			setupStreamHandler();
 			if (strmHandler == null)
 				throw new MalformedURLException(org.apache.harmony.luni.util.Msg.getString(
-						"K00b3", protocol));
+						"K00b3", protocol)); //$NON-NLS-1$
 		} else {
 			SecurityManager sm = System.getSecurityManager();
 			if (sm != null)
@@ -424,7 +425,7 @@
 		if (host != null && host.length() > 0) {
 			authority = host;
 			if (port != -1)
-				authority = authority + ":" + port;
+				authority = authority + ":" + port; //$NON-NLS-1$
 		}
 		if (fixHost) {
 			if (host != null && (index = host.lastIndexOf('@')) > -1) {
@@ -549,11 +550,11 @@
 		// Check if there is a list of packages which can provide handlers.
 		// If so, then walk this list looking for an applicable one.
 		String packageList = (String) AccessController
-				.doPrivileged(new PriviAction("java.protocol.handler.pkgs"));
+				.doPrivileged(new PriviAction("java.protocol.handler.pkgs")); //$NON-NLS-1$
 		if (packageList != null) {
-			StringTokenizer st = new StringTokenizer(packageList, "|");
+			StringTokenizer st = new StringTokenizer(packageList, "|"); //$NON-NLS-1$
 			while (st.hasMoreTokens()) {
-				String className = st.nextToken() + "." + protocol + ".Handler";
+				String className = st.nextToken() + "." + protocol + ".Handler"; //$NON-NLS-1$ //$NON-NLS-2$
 				try {
 					strmHandler = (URLStreamHandler) Class.forName(className,
 							true, ClassLoader.getSystemClassLoader())
@@ -567,8 +568,8 @@
 
 		// No one else has provided a handler, so try our internal one.
 		try {
-			String className = "org.apache.harmony.luni.internal.net.www.protocol." + protocol
-					+ ".Handler";
+			String className = "org.apache.harmony.luni.internal.net.www.protocol." + protocol //$NON-NLS-1$
+					+ ".Handler"; //$NON-NLS-1$
 			strmHandler = (URLStreamHandler) Class.forName(className)
 					.newInstance();
 			streamHandlers.put(protocol, strmHandler);
@@ -660,7 +661,7 @@
 	 */
 	public URLConnection openConnection(Proxy proxy) throws IOException {
 		if(null == proxy){
-			throw new IllegalArgumentException(Msg.getString("K034c"));
+			throw new IllegalArgumentException(Msg.getString("K034c")); //$NON-NLS-1$
 		}
 		return strmHandler.openConnection(this, proxy);
 	}
@@ -720,7 +721,7 @@
 			}
 			setupStreamHandler();
 			if (strmHandler == null)
-				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K00b3",
+				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K00b3", //$NON-NLS-1$
 						protocol));
 		} catch (ClassNotFoundException e) {
 			throw new java.io.IOException(e.toString());
@@ -857,11 +858,11 @@
 			String authority, String userInfo, String path, String query,
 			String ref) {
 		String file = path;
-		if (query != null && !query.equals("")) {
+		if (query != null && !query.equals("")) { //$NON-NLS-1$
 			if (file != null)
-				file = file + "?" + query;
+				file = file + "?" + query; //$NON-NLS-1$
 			else
-				file = "?" + query;
+				file = "?" + query; //$NON-NLS-1$
 		}
 		set(protocol, host, port, file, ref);
 		this.authority = authority;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java Mon May  8 11:04:08 2006
@@ -200,12 +200,12 @@
 	public Enumeration findResources(final String name) throws IOException {
 		if (name == null)
 			return null;
-		Vector result = (Vector) AccessController.doPrivileged(
-				new PrivilegedAction() {
-					public Object run() {
-						return findResources(urls, name, new Vector());
-					}
-				}, currentContext);
+		Vector result = AccessController.doPrivileged(
+                new PrivilegedAction<Vector>() {
+                    public Vector run() {
+                        return findResources(urls, name, new Vector());
+                    }
+                }, currentContext);
 		SecurityManager sm;
 		int length = result.size();
 		if (length > 0 && (sm = System.getSecurityManager()) != null) {
@@ -494,9 +494,9 @@
 	 *            URLClassloader
 	 */
 	public static URLClassLoader newInstance(final URL[] urls) {
-		URLClassLoader sub = (URLClassLoader) AccessController
-				.doPrivileged(new PrivilegedAction() {
-					public Object run() {
+		URLClassLoader sub = AccessController.doPrivileged(
+                new PrivilegedAction<URLClassLoader>() {
+					public URLClassLoader run() {
 						return new SubURLClassLoader(urls);
 					}
 				});
@@ -520,9 +520,9 @@
 	 */
 	public static URLClassLoader newInstance(final URL[] urls,
 			final ClassLoader parentCl) {
-		URLClassLoader sub = (URLClassLoader) AccessController
-				.doPrivileged(new PrivilegedAction() {
-					public Object run() {
+		URLClassLoader sub = AccessController.doPrivileged(
+                new PrivilegedAction<URLClassLoader>() {
+					public URLClassLoader run() {
 						return new SubURLClassLoader(urls, parentCl);
 					}
 				});
@@ -592,9 +592,9 @@
 	 */
 	protected Class findClass(final String clsName)
 			throws ClassNotFoundException {
-		Class cls = (Class) AccessController.doPrivileged(
-				new PrivilegedAction() {
-					public Object run() {
+		Class cls = AccessController.doPrivileged(
+				new PrivilegedAction<Class>() {
+					public Class run() {
 						return findClassImpl(urls, clsName);
 					}
 				}, currentContext);
@@ -639,9 +639,9 @@
 	public URL findResource(final String name) {
 		if (name == null)
 			return null;
-		URL result = (URL) AccessController.doPrivileged(
-				new PrivilegedAction() {
-					public Object run() {
+		URL result = AccessController.doPrivileged(
+                new PrivilegedAction<URL>() {
+					public URL run() {
 						return findResourceImpl(urls, name);
 					}
 				}, currentContext);
@@ -908,7 +908,7 @@
 	 */
 	private ArrayList readLines(InputStream in) throws IOException {
 		byte[] buff = new byte[144];
-		ArrayList lines = new ArrayList();
+		ArrayList<String> lines = new ArrayList<String>();
 		int pos = 0;
 		int next;
 		while ((next = in.read()) != -1) {
@@ -1139,7 +1139,7 @@
 		if (ze != null) {
 			if (url.equals(urls[indexNumber])) {
 				try {
-					Hashtable index = new Hashtable(15);
+					Hashtable<String,URL[]> index = new Hashtable<String,URL[]>(15);
 					InputStream indexIS = jf.getInputStream(ze);
 					List lines = readLines(indexIS);
 					indexIS.close();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java Mon May  8 11:04:08 2006
@@ -71,7 +71,7 @@
 	/**
 	 * Cache for storing Content handler
 	 */
-	static Hashtable contentHandlers = new Hashtable();
+	static Hashtable<String,Object> contentHandlers = new Hashtable<String,Object>();
 
 	/**
 	 * A hashtable that maps the filename extension (key) to a MIME-type
@@ -226,7 +226,7 @@
 		}
 
 		if (cHandler == null) {
-			cHandler = AccessController.doPrivileged(new PrivilegedAction() {
+			cHandler = AccessController.doPrivileged(new PrivilegedAction<Object>() {
 				public Object run() {
 					try {
 						String className = "org.apache.harmony.luni.internal.net.www.content."

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownHostException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownHostException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownHostException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownHostException.java Mon May  8 11:04:08 2006
@@ -24,7 +24,9 @@
  */
 public class UnknownHostException extends IOException {
 
-	/**
+    private static final long serialVersionUID = -4639126076052875403L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public UnknownHostException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownServiceException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownServiceException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownServiceException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/UnknownServiceException.java Mon May  8 11:04:08 2006
@@ -26,7 +26,9 @@
  */
 public class UnknownServiceException extends IOException {
 
-	/**
+    private static final long serialVersionUID = -4169033248853639508L;
+
+    /**
 	 * Constructs a new instance of this class with its walkback filled in.
 	 */
 	public UnknownServiceException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Currency.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Currency.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Currency.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Currency.java Mon May  8 11:04:08 2006
@@ -26,7 +26,7 @@
 
 	private static final long serialVersionUID = -158308464356906721L;
 
-	private static Hashtable codesToCurrencies = new Hashtable();
+	private static Hashtable<String,Currency> codesToCurrencies = new Hashtable<String,Currency>();
 
 	private String currencyCode;
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java Mon May  8 11:04:08 2006
@@ -345,13 +345,13 @@
 	 */
 	public static Locale[] getAvailableLocales() {
 		if (availableLocales == null) {
-			availableLocales = (Locale[]) AccessController
-					.doPrivileged(new PrivilegedAction() {
-						public Object run() {
-							return find("org/apache/harmony/luni/internal/locale/Locale_"); //$NON-NLS-1$
-						}
-					});
-		}
+            availableLocales = AccessController
+                    .doPrivileged(new PrivilegedAction<Locale[]>() {
+                        public Locale[] run() {
+                            return find("org/apache/harmony/luni/internal/locale/Locale_"); //$NON-NLS-1$
+                        }
+                    });
+        }
 		return (Locale[]) availableLocales.clone();
 	}
 
@@ -691,9 +691,8 @@
 	}
 
 	static ResourceBundle getBundle(final String clName, final Locale locale) {
-		return (ResourceBundle) AccessController
-				.doPrivileged(new PrivilegedAction() {
-					public Object run() {
+		return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
+					public ResourceBundle run() {
 						return ResourceBundle.getBundle("org.apache.harmony.luni.internal.locale." //$NON-NLS-1$
 								+ clName, locale);
 					}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java Mon May  8 11:04:08 2006
@@ -224,11 +224,11 @@
 		ResourceBundle bundle = null;
 		String bundleName = base + locale;
 		Object cacheKey = loader != null ? (Object) loader : (Object) "null"; //$NON-NLS-1$
-		Hashtable loaderCache;
+		Hashtable<String,ResourceBundle> loaderCache;
 		synchronized (cache) {
-			loaderCache = (Hashtable) cache.get(cacheKey);
+			loaderCache = (Hashtable<String,ResourceBundle>) cache.get(cacheKey);
 			if (loaderCache == null) {
-				loaderCache = new Hashtable(13);
+				loaderCache = new Hashtable<String,ResourceBundle>(13);
 				cache.put(cacheKey, loaderCache);
 			}
 		}
@@ -257,10 +257,8 @@
 
 		if (bundle == null) {
 			final String fileName = bundleName.replace('.', '/');
-			InputStream stream = null;
-			stream = (InputStream) AccessController
-					.doPrivileged(new PrivilegedAction() {
-						public Object run() {
+			InputStream stream = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
+						public InputStream run() {
 							return loader == null ? ClassLoader
 									.getSystemResourceAsStream(fileName
 											+ ".properties") : loader //$NON-NLS-1$

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/MimeTable.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/MimeTable.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/MimeTable.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/MimeTable.java Mon May  8 11:04:08 2006
@@ -33,7 +33,7 @@
 
 public class MimeTable implements FileNameMap {
 
-	public static final String UNKNOWN = "content/unknown";
+	public static final String UNKNOWN = "content/unknown"; //$NON-NLS-1$
 
 	/**
 	 * A hash table containing the mapping between extensions and mime types.
@@ -42,10 +42,10 @@
 
 	// Default mapping.
 	static {
-		types.put("text", "text/plain");
-		types.put("txt", "text/plain");
-		types.put("htm", "text/html");
-		types.put("html", "text/html");
+		types.put("text", "text/plain"); //$NON-NLS-1$ //$NON-NLS-2$
+		types.put("txt", "text/plain"); //$NON-NLS-1$ //$NON-NLS-2$
+		types.put("htm", "text/html"); //$NON-NLS-1$ //$NON-NLS-2$
+		types.put("html", "text/html"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	/**
@@ -56,11 +56,10 @@
 	 * standard java.util.Properties.load(...) format.
 	 */
 	public MimeTable() {
-		InputStream str = (InputStream) AccessController
-				.doPrivileged(new PrivilegedAction() {
-					public Object run() {
+		InputStream str = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
+					public InputStream run() {
 						return MimeTable.this.getClass().getResourceAsStream(
-								"types.properties");
+								"types.properties"); //$NON-NLS-1$
 					}
 				});
 
@@ -80,14 +79,14 @@
 	 *            java.lang.String The file whose extension will be mapped.
 	 */
 	public String getContentTypeFor(String filename) {
-		if (filename.endsWith("/"))
+		if (filename.endsWith("/")) //$NON-NLS-1$
 			// a directory, return html
-			return (String) types.get("html");
+			return (String) types.get("html"); //$NON-NLS-1$
 		int lastCharInExtension = filename.lastIndexOf('#');
 		if (lastCharInExtension < 0)
 			lastCharInExtension = filename.length();
 		int firstCharInExtension = filename.lastIndexOf('.') + 1;
-		String ext = "";
+		String ext = ""; //$NON-NLS-1$
 		if (firstCharInExtension > filename.lastIndexOf('/'))
 			ext = filename.substring(firstCharInExtension, lastCharInExtension);
 		return (String) types.get(ext.toLowerCase());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Header.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/http/Header.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Header.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Header.java Mon May  8 11:04:08 2006
@@ -15,189 +15,216 @@
 
 package org.apache.harmony.luni.internal.net.www.protocol.http;
 
-
-import java.util.*;
-
-/**
- * The general structure for request / reponse header. It is essentially constructed by
- * hashtable with key indexed in a vector for position lookup.
- *
- */
-
-public class Header implements Cloneable{
-	/**
-	 * The default amount of fields for a header
-	 */
-	private static final int incCapacity = 20;
-
-	/* we use the non-synchronized ArrayList and HashMap instead of
-	 * the synchronized Vector and Hashtable
-	 */
-	private ArrayList props = new ArrayList(incCapacity);
-	private HashMap keyTable = new HashMap(incCapacity);
-	private String statusLine;
-
-/**
- * A generic header structure. Used mostly for request / response header.
- * The key/value pair of the header may be inserted for later use. The key
- * is stored in an array for indexed slot access.
- *
- *
- */
-public Header() {}
-
-public Object clone(){
-	try {
-		Header clone = (Header) super.clone();
-
-		clone.props = (ArrayList) props.clone();
-		HashMap cloneTable = clone.keyTable = new HashMap(incCapacity);
-		Iterator entries = keyTable.entrySet().iterator();
-		while(entries.hasNext()) {
-			Map.Entry next = (Map.Entry) entries.next();
-			cloneTable.put(next.getKey(), ((LinkedList) next.getValue()).clone());
-		}
-		return clone;
-	} catch (CloneNotSupportedException e) {return null;}
-}
-/**
- * Add a field with the specified value.
- *
- *
- * @param key java.lang.String
- * @param value java.lang.String
- */
-public void add(String key, String value) {
-	if(key == null) {
-		throw new NullPointerException();
-	}
-	LinkedList list = (LinkedList) keyTable.get(key);
-	if(list == null) {
-		list = new LinkedList();
-		keyTable.put(key.toLowerCase(), list);
-	}
-	list.add(value);
-	props.add(key);
-	props.add(value);
-}
-/**
- * Set a field with the specified value.  If the field is not found, it is
- * added.  If the field is found, the existing value(s) are overwritten.
- *
- *
- * @param key java.lang.String
- * @param value java.lang.String
- */
-public void set(String key, String value) {
-	if(key == null) {
-		throw new NullPointerException();
-	}
-	LinkedList list = (LinkedList) keyTable.get(key);
-	if(list == null) {
-		add(key, value);
-	}
-	else {
-		list.clear();
-		list.add(value);
-		for(int i=0; i<props.size(); i+=2) {
-			String propKey = (String) props.get(i);
-			if(propKey != null && key.equals(propKey)) {
-				props.set(i+1, value);
-			}
-		}
-	}
-}
-
-/**
- * Provides an unmodifiable map with all String header names mapped to their String values.
- * The map keys are Strings and the values are unmodifiable Lists of Strings.
- * @return an unmodifiable map of the headers
- *
- * @since 1.4
- */
-public Map getFieldMap() {
-	Map result = new HashMap(keyTable.size());
-	Iterator iterator = keyTable.entrySet().iterator();
-	while(iterator.hasNext()) {
-		Map.Entry next = (Map.Entry) iterator.next();
-		result.put(next.getKey(), Collections.unmodifiableList((LinkedList) next.getValue()));
-	}
-	return Collections.unmodifiableMap(result);
-}
-
-/**
- * Answers the element at <code>pos</code>, null if no such element exist.
- *
- * @return java.lang.String		the value of the key
- * @param  pos	int				the position to look for
- */
-public String get(int pos) {
-	if (pos >= 0 && pos < props.size() / 2) {
-		return (String) props.get(pos * 2 + 1);
-	}
-	return null;
-}
-/**
- * Answers the key of this header at <code>pos</code>, null if there are fewer keys in the header
- *
- *
- * @return java.lang.String		the key the desired position
- * @param pos int		the position to look for
- */
-public String getKey(int pos) {
-	if (pos >= 0 && pos < props.size() / 2) {
-		return (String) props.get(pos * 2);
-	}
-	return null;
-}
-/**
- * Answers the value corresponding to the specified key, null if no such key exists.
- *
- *
- * @return java.lang.String
- * @param key java.lang.String
- */
-public String get(String key) {
-	LinkedList result = (LinkedList) keyTable.get(key.toLowerCase());
-	if(result == null) {
-		return null;
-	}
-	return (String) result.getLast();
-}
-
-/**
- * Answers the number of keys stored in this header
- *
- *
- * @return int
- */
-public int length() {
-	return props.size() / 2;
-}
-
-/**
- * Sets the status line in the header
- * request example: GET / HTTP/1.1
- * response example: HTTP/1.1 200 OK
- * @param statusLine
- */
-public void setStatusLine(String statusLine) {
-	this.statusLine = statusLine;
-	//we add the status line to the list of headers so that it is accessible
-	//from java.net.HttpURLConnection.getResponseCode()
-	//which calls org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHeaderField(0) to get it
-	props.add(0, null);
-	props.add(1, statusLine);
-}
-
-/**
- * Gets the status line in the header
- * request example: GET / HTTP/1.1
- * response example: HTTP/1.1 200 OK
- * @return the status line
- */
-public String getStatusLine() {
-	return statusLine;
-}
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+/**
+ * The general structure for request / reponse header. It is essentially
+ * constructed by hashtable with key indexed in a vector for position lookup.
+ * 
+ */
+
+public class Header implements Cloneable {
+    /**
+     * The default amount of fields for a header
+     */
+    private static final int incCapacity = 20;
+
+    /*
+     * we use the non-synchronized ArrayList and HashMap instead of the
+     * synchronized Vector and Hashtable
+     */
+    private ArrayList props = new ArrayList(incCapacity);
+
+    private HashMap keyTable = new HashMap(incCapacity);
+
+    private String statusLine;
+
+    /**
+     * A generic header structure. Used mostly for request / response header.
+     * The key/value pair of the header may be inserted for later use. The key
+     * is stored in an array for indexed slot access.
+     */
+    public Header() {
+    }
+
+    public Object clone() {
+        try {
+            Header clone = (Header) super.clone();
+
+            clone.props = (ArrayList) props.clone();
+            HashMap cloneTable = clone.keyTable = new HashMap(incCapacity);
+            Iterator entries = keyTable.entrySet().iterator();
+            while (entries.hasNext()) {
+                Map.Entry next = (Map.Entry) entries.next();
+                cloneTable.put(next.getKey(), ((LinkedList) next.getValue())
+                        .clone());
+            }
+            return clone;
+        } catch (CloneNotSupportedException e) {
+            return null;
+        }
+    }
+
+    /**
+     * Add a field with the specified value.
+     * 
+     * @param key
+     *            java.lang.String
+     * @param value
+     *            java.lang.String
+     */
+    public void add(String key, String value) {
+        if (key == null) {
+            throw new NullPointerException();
+        }
+        LinkedList list = (LinkedList) keyTable.get(key);
+        if (list == null) {
+            list = new LinkedList();
+            keyTable.put(key.toLowerCase(), list);
+        }
+        list.add(value);
+        props.add(key);
+        props.add(value);
+    }
+
+    /**
+     * Set a field with the specified value. If the field is not found, it is
+     * added. If the field is found, the existing value(s) are overwritten.
+     * 
+     * 
+     * @param key
+     *            java.lang.String
+     * @param value
+     *            java.lang.String
+     */
+    public void set(String key, String value) {
+        if (key == null) {
+            throw new NullPointerException();
+        }
+        LinkedList list = (LinkedList) keyTable.get(key);
+        if (list == null) {
+            add(key, value);
+        } else {
+            list.clear();
+            list.add(value);
+            for (int i = 0; i < props.size(); i += 2) {
+                String propKey = (String) props.get(i);
+                if (propKey != null && key.equals(propKey)) {
+                    props.set(i + 1, value);
+                }
+            }
+        }
+    }
+
+    /**
+     * Provides an unmodifiable map with all String header names mapped to their
+     * String values. The map keys are Strings and the values are unmodifiable
+     * Lists of Strings.
+     * 
+     * @return an unmodifiable map of the headers
+     * 
+     * @since 1.4
+     */
+    public Map getFieldMap() {
+        Map result = new HashMap(keyTable.size());
+        Iterator iterator = keyTable.entrySet().iterator();
+        while (iterator.hasNext()) {
+            Map.Entry next = (Map.Entry) iterator.next();
+            result.put(next.getKey(), Collections
+                    .unmodifiableList((LinkedList) next.getValue()));
+        }
+        return Collections.unmodifiableMap(result);
+    }
+
+    /**
+     * Answers the element at <code>pos</code>, null if no such element
+     * exist.
+     * 
+     * @return java.lang.String the value of the key
+     * @param pos
+     *            int the position to look for
+     */
+    public String get(int pos) {
+        if (pos >= 0 && pos < props.size() / 2) {
+            return (String) props.get(pos * 2 + 1);
+        }
+        return null;
+    }
+
+    /**
+     * Answers the key of this header at <code>pos</code>, null if there are
+     * fewer keys in the header
+     * 
+     * 
+     * @return java.lang.String the key the desired position
+     * @param pos
+     *            int the position to look for
+     */
+    public String getKey(int pos) {
+        if (pos >= 0 && pos < props.size() / 2) {
+            return (String) props.get(pos * 2);
+        }
+        return null;
+    }
+
+    /**
+     * Answers the value corresponding to the specified key, null if no such key
+     * exists.
+     * 
+     * 
+     * @return java.lang.String
+     * @param key
+     *            java.lang.String
+     */
+    public String get(String key) {
+        LinkedList result = (LinkedList) keyTable.get(key.toLowerCase());
+        if (result == null) {
+            return null;
+        }
+        return (String) result.getLast();
+    }
+
+    /**
+     * Answers the number of keys stored in this header
+     * 
+     * 
+     * @return int
+     */
+    public int length() {
+        return props.size() / 2;
+    }
+
+    /**
+     * Sets the status line in the header request example: GET / HTTP/1.1
+     * response example: HTTP/1.1 200 OK
+     * 
+     * @param statusLine
+     */
+    public void setStatusLine(String statusLine) {
+        this.statusLine = statusLine;
+        // we add the status line to the list of headers so that it is
+        // accessible
+        // from java.net.HttpURLConnection.getResponseCode()
+        // which calls
+        // org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHeaderField(0)
+        // to get it
+        props.add(0, null);
+        props.add(1, statusLine);
+    }
+
+    /**
+     * Gets the status line in the header request example: GET / HTTP/1.1
+     * response example: HTTP/1.1 200 OK
+     * 
+     * @return the status line
+     */
+    public String getStatusLine() {
+        return statusLine;
+    }
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.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/jar/JarURLConnection.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java Mon May  8 11:04:08 2006
@@ -28,6 +28,7 @@
 import java.security.PrivilegedAction;
 import java.util.Comparator;
 import java.util.Date;
+import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.TreeSet;
 import java.util.jar.JarEntry;
@@ -47,7 +48,7 @@
  * 
  */
 public class JarURLConnection extends java.net.JarURLConnection {
-	static Hashtable jarCache = new Hashtable();
+	static Hashtable<Object,CacheEntry> jarCache = new Hashtable<Object,CacheEntry>();
 
 	InputStream jarInput;
 
@@ -61,12 +62,11 @@
 
 	static int Limit;
 	static {
-		Limit = ((Integer) AccessController
-				.doPrivileged(new PrivilegedAction() {
-					public Object run() {
+		Limit = AccessController.doPrivileged(new PrivilegedAction<Integer>() {
+					public Integer run() {
 						return Integer.getInteger("jar.cacheSize", 500);
 					}
-				})).intValue();
+				});
 		VM.closeJars();
 	}
 
@@ -179,9 +179,8 @@
 
 		final String externalForm = jarFileURLConnection.getURL()
 				.toExternalForm();
-		jarFile = (JarFile) AccessController
-				.doPrivileged(new PrivilegedAction() {
-					public Object run() {
+		jarFile = AccessController.doPrivileged(new PrivilegedAction<JarFile>() {
+					public JarFile run() {
 						try {
 							return openJarFile(null, externalForm, false);
 						} catch (IOException e) {
@@ -195,9 +194,8 @@
 		// Build a temp jar file
 		final InputStream is = jarFileURLConnection.getInputStream();
 		try {
-			jarFile = (JarFile) AccessController
-					.doPrivileged(new PrivilegedAction() {
-						public Object run() {
+			jarFile = AccessController.doPrivileged(new PrivilegedAction<JarFile>() {
+						public JarFile run() {
 							try {
 								File tempJar = File.createTempFile("hyjar_",
 										".tmp", null);
@@ -347,7 +345,7 @@
 	 * @see java.io.IOException
 	 * @see #setContentHandlerFactory(ContentHandlerFactory)
 	 */
-	public Object getContent() throws java.io.IOException {
+	public Object getContent() throws IOException {
 		if (!connected)
 			connect();
 		// if there is no Jar Entry, return a JarFile
@@ -377,7 +375,7 @@
 	 * Closes the cached files.
 	 */
 	public static void closeCachedFiles() {
-		java.util.Enumeration elemEnum = jarCache.elements();
+		Enumeration<CacheEntry> elemEnum = jarCache.elements();
 		while (elemEnum.hasMoreElements()) {
 			try {
 				ZipFile zip = (ZipFile) ((CacheEntry) elemEnum.nextElement())

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyClassFile.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyClassFile.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyClassFile.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyClassFile.java Mon May  8 11:04:08 2006
@@ -256,7 +256,7 @@
 			}
 		}
 
-		ArrayList allMethods = new ArrayList(25);
+		ArrayList<ProxyMethod> allMethods = new ArrayList<ProxyMethod>(25);
 		allMethods.add(new ProxyMethod(ObjectEqualsMethod));
 		allMethods.add(new ProxyMethod(ObjectHashCodeMethod));
 		allMethods.add(new ProxyMethod(ObjectToStringMethod));
@@ -269,7 +269,7 @@
 		allMethods.toArray(proxyMethods);
 	}
 
-	private void findMethods(Class nextInterface, ArrayList allMethods,
+	private void findMethods(Class nextInterface, ArrayList<ProxyMethod> allMethods,
 			HashSet interfacesSeen) {
 		// add the nextInterface's methods to allMethods
 		// if an equivalent method already exists then return types must be
@@ -291,10 +291,8 @@
 
 		Class[] superInterfaces = nextInterface.getInterfaces();
 		for (int i = 0, length = superInterfaces.length; i < length; i++)
-			findMethods(superInterfaces[i], allMethods, interfacesSeen); // recursion
-																			// should
-																			// be
-																			// minimal
+            // recursion should be minimal
+			findMethods(superInterfaces[i], allMethods, interfacesSeen); 
 	}
 
 	private void generateCodeAttribute(ProxyMethod pMethod) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/AbstractMemorySpy.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/AbstractMemorySpy.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/AbstractMemorySpy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/AbstractMemorySpy.java Mon May  8 11:04:08 2006
@@ -29,9 +29,9 @@
 abstract class AbstractMemorySpy implements IMemorySpy {
 
 	// TODO: figure out how to prevent this being a synchronization bottleneck
-	protected Map memoryInUse = new HashMap(); // Shadow to Wrapper
+	protected Map<PlatformAddress,AddressWrapper> memoryInUse = new HashMap(); // Shadow to Wrapper
 
-	protected Map refToShadow = new HashMap(); // Reference to Shadow
+	protected Map<Reference,PlatformAddress> refToShadow = new HashMap(); // Reference to Shadow
 
 	protected ReferenceQueue notifyQueue = new ReferenceQueue();
 
@@ -102,7 +102,7 @@
 	protected void orphanedMemory(Reference ref) {
 		AddressWrapper wrapper;
 		synchronized (lock) {
-			Object shadow = refToShadow.remove(ref);
+			PlatformAddress shadow = refToShadow.remove(ref);
 			wrapper = (AddressWrapper) memoryInUse.remove(shadow);
 		}
         ref.clear();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Inet6Util.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Inet6Util.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Inet6Util.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Inet6Util.java Mon May  8 11:04:08 2006
@@ -53,8 +53,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 token = "";
 		String prevToken = "";
 		int doubleColonIndex = -1; // If a double colon exists, we need to

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/InvalidJarIndexException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/InvalidJarIndexException.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/InvalidJarIndexException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/InvalidJarIndexException.java Mon May  8 11:04:08 2006
@@ -22,7 +22,9 @@
  */
 public class InvalidJarIndexException extends RuntimeException {
 
-	/**
+    private static final long serialVersionUID = 1L;
+
+    /**
 	 * Constructs a new instance of this class.
 	 */
 	public InvalidJarIndexException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/MsgHelp.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/MsgHelp.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/MsgHelp.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/MsgHelp.java Mon May  8 11:04:08 2006
@@ -107,7 +107,7 @@
 		try {
 			final ClassLoader loader = VM.bootCallerClassLoader();
 			return (ResourceBundle) AccessController
-					.doPrivileged(new PrivilegedAction() {
+					.doPrivileged(new PrivilegedAction<Object>() {
 						public Object run() {
 							return ResourceBundle.getBundle(resource, locale,
 									loader);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java?rev=405112&r1=405111&r2=405112&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java Mon May  8 11:04:08 2006
@@ -26,9 +26,9 @@
 
 	private static OIDDatabase instance = new OIDDatabase();
 
-	private Set oids = new HashSet();
+	private Set<DBEntry> oids = new HashSet<DBEntry>();
 
-	private Set algorithms = new HashSet();
+	private Set<DBEntry> algorithms = new HashSet<DBEntry>();
 
 	/**
 	 * Private constructor to enforce singleton pattern
@@ -141,12 +141,12 @@
 	}
 
 	private Set getAllEquivalents(String value, Iterator it) {
-		Set result = null;
+		Set<String> result = null;
 		while (it.hasNext()) {
 			DBEntry element = (DBEntry) it.next();
 			if (element.getValue().equals(value)) {
 				Set allMatchingDBEntries = element.getAllEquivalents();
-				result = new HashSet();
+				result = new HashSet<String>();
 				Iterator dbIt = allMatchingDBEntries.iterator();
 				while (dbIt.hasNext()) {
 					DBEntry matchingEntry = (DBEntry) dbIt.next();
@@ -158,7 +158,7 @@
 	}
 
 	static class DBEntry {
-		private List equivalents = new LinkedList();
+		private List<DBEntry> equivalents = new LinkedList();
 
 		private String value;
 



Mime
View raw message