jdk/test/java/net/URL/GetContent.java
changeset 6115 7c523cf2bc8a
parent 5506 202f599c92aa
child 7668 d4a77089c587
--- a/jdk/test/java/net/URL/GetContent.java	Tue Jul 20 10:41:50 2010 -0400
+++ b/jdk/test/java/net/URL/GetContent.java	Wed Jul 21 13:29:26 2010 +0100
@@ -53,11 +53,13 @@
 
             // wait for client to read response - otherwise http
             // client get error and re-establish connection
-            Thread.currentThread().sleep(2000);
+            Thread.sleep(2000);
 
             s.close();
         } catch (Exception e) {
             e.printStackTrace();
+        } finally {
+            try { ss.close(); } catch (IOException unused) {}
         }
      }
 
@@ -81,8 +83,6 @@
              error = false;
          }
 
-         ss.close();
-
          if (error)
              throw new RuntimeException("No IOException generated.");
      }