6937703: java/net regression test issues with samevm
Reviewed-by: alanb
diff --git a/test/java/net/URLClassLoader/HttpTest.java b/test/java/net/URLClassLoader/HttpTest.java
index e04331f..c7935b2 100644
--- a/test/java/net/URLClassLoader/HttpTest.java
+++ b/test/java/net/URLClassLoader/HttpTest.java
@@ -56,9 +56,9 @@
}
public void run() {
+ InputStream in = null;
try {
-
- InputStream in = s.getInputStream();
+ in = s.getInputStream();
for (;;) {
// read entire request from client
@@ -111,6 +111,9 @@
} // for
} catch (Exception e) {
+ unexpected(e);
+ } finally {
+ if (in != null) { try {in.close(); } catch(IOException e) {unexpected(e);} }
}
}
}
@@ -131,6 +134,11 @@
}
}
+ void unexpected(Exception e) {
+ System.out.println(e);
+ e.printStackTrace();
+ }
+
public static HttpServer create() throws Exception {
if (svr != null)
return svr;
@@ -211,6 +219,7 @@
// one GET request
svr.counters().reset();
InputStream in = cl.getResourceAsStream("foo2.gif");
+ in.close();
System.out.println(svr.counters());
if (svr.counters().getCount() > 1) {
failed = true;