--- /home/cpdev/src/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java	2005-07-14 05:32:34.000000000 +0000
+++ gnu/java/net/protocol/http/HTTPURLConnection.java	2005-06-30 05:34:10.000000000 +0000
@@ -82,12 +82,11 @@
    */
   private HTTPConnection connection;
 
-  // These are package private for use in anonymous inner classes.
-  String proxyHostname;
-  int proxyPort;
-  String agent;
-  boolean keepAlive;
-  int maxConnections;
+  private String proxyHostname;
+  private int proxyPort;
+  private String agent;
+  private boolean keepAlive;
+  private int maxConnections;
 
   private Request request;
   private Headers requestHeaders;
@@ -234,85 +233,82 @@
           {
             // Follow redirect
             String location = response.getHeader("Location");
-	    if (location != null)
+            String connectionUri = connection.getURI();
+            int start = connectionUri.length();
+            if (location.startsWith(connectionUri) &&
+                location.charAt(start) == '/')
+              {
+                file = location.substring(start);
+                retry = true;
+              }
+            else if (location.startsWith("http:"))
+              {
+                connection.close();
+                connection = null;
+                secure = false;
+                start = 7;
+                int end = location.indexOf('/', start);
+                host = location.substring(start, end);
+                int ci = host.lastIndexOf(':');
+                if (ci != -1)
+                  {
+                    port = Integer.parseInt(host.substring (ci + 1));
+                    host = host.substring(0, ci);
+                  }
+                else
+                  {
+                    port = HTTPConnection.HTTP_PORT;
+                  }
+                file = location.substring(end);
+                retry = true;
+              }
+            else if (location.startsWith("https:"))
+              {
+                connection.close();
+                connection = null;
+                secure = true;
+                start = 8;
+                int end = location.indexOf('/', start);
+                host = location.substring(start, end);
+                int ci = host.lastIndexOf(':');
+                if (ci != -1)
+                  {
+                    port = Integer.parseInt(host.substring (ci + 1));
+                    host = host.substring(0, ci);
+                  }
+                else
+                  {
+                    port = HTTPConnection.HTTPS_PORT;
+                  }
+                file = location.substring(end);
+                retry = true;
+              }
+	    else if (location.length() > 0)
 	      {
-		String connectionUri = connection.getURI();
-		int start = connectionUri.length();
-		if (location.startsWith(connectionUri) &&
-		    location.charAt(start) == '/')
+		// Malformed absolute URI, treat as file part of URI
+		if (location.charAt(0) == '/')
 		  {
-		    file = location.substring(start);
-		    retry = true;
+		    // Absolute path
+		    file = location;
 		  }
-		else if (location.startsWith("http:"))
+		else
 		  {
-		    connection.close();
-		    connection = null;
-		    secure = false;
-		    start = 7;
-		    int end = location.indexOf('/', start);
-		    host = location.substring(start, end);
-		    int ci = host.lastIndexOf(':');
-		    if (ci != -1)
-		      {
-			port = Integer.parseInt(host.substring (ci + 1));
-			host = host.substring(0, ci);
-		      }
-		    else
-		      {
-			port = HTTPConnection.HTTP_PORT;
-		      }
-		    file = location.substring(end);
-		    retry = true;
-		  }
-		else if (location.startsWith("https:"))
-		  {
-		    connection.close();
-		    connection = null;
-		    secure = true;
-		    start = 8;
-		    int end = location.indexOf('/', start);
-		    host = location.substring(start, end);
-		    int ci = host.lastIndexOf(':');
-		    if (ci != -1)
-		      {
-			port = Integer.parseInt(host.substring (ci + 1));
-			host = host.substring(0, ci);
-		      }
-		    else
-		      {
-			port = HTTPConnection.HTTPS_PORT;
-		      }
-		    file = location.substring(end);
-		    retry = true;
-		  }
-		else if (location.length() > 0)
-		  {
-		    // Malformed absolute URI, treat as file part of URI
-		    if (location.charAt(0) == '/')
-		      {
-			// Absolute path
-			file = location;
-		      }
-		    else
-		      {
-			// Relative path
-			int lsi = file.lastIndexOf('/');
-			file = (lsi == -1) ? "/" : file.substring(0, lsi + 1);
+		    // Relative path
+		    int lsi = file.lastIndexOf('/');
+		    file = (lsi == -1) ? "/" : file.substring(0, lsi + 1);
 		    file += location;
-		      }
-		    retry = true;
 		  }
+		retry = true;
 	      }
           }
         else
           {
             responseSink = new ByteArrayInputStream(reader.toByteArray ());
             if (response.getCode() == 404)
-	      {
-		errorSink = responseSink;
-		throw new FileNotFoundException(url.toString());
-	      }
+              {
+                errorSink = responseSink;
+                throw new FileNotFoundException(url.toString());
+              }
           }
       }
     while (retry);
@@ -329,8 +325,6 @@
     if (keepAlive)
       {
         StringBuffer buf = new StringBuffer(secure ? "https://" : "http://");
-        buf.append(Thread.currentThread().hashCode());
-        buf.append('@');
         buf.append(host);
         buf.append(':');
         buf.append(port);
