6513803: httpserver regression test Test13 failing and causing NullPointerException
authormichaelm
Mon, 29 Jun 2009 13:10:33 +0100
changeset 3070 0175bbf9a833
parent 3060 4477a1762fa5
child 3071 4c41936173e7
child 3073 5e93bd389012
6513803: httpserver regression test Test13 failing and causing NullPointerException Summary: check for NPEs Reviewed-by: chegar
jdk/test/com/sun/net/httpserver/Test1.java
jdk/test/com/sun/net/httpserver/Test12.java
jdk/test/com/sun/net/httpserver/Test13.java
jdk/test/com/sun/net/httpserver/Test3.java
jdk/test/com/sun/net/httpserver/Test4.java
jdk/test/com/sun/net/httpserver/Test5.java
jdk/test/com/sun/net/httpserver/Test9.java
jdk/test/com/sun/net/httpserver/Test9a.java
jdk/test/com/sun/net/httpserver/TestLogging.java
--- a/jdk/test/com/sun/net/httpserver/Test1.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test1.java	Mon Jun 29 13:10:33 2009 +0100
@@ -86,9 +86,12 @@
             System.out.println ("OK");
         } finally {
             delay();
-            s1.stop(2);
-            s2.stop(2);
-            executor.shutdown ();
+            if (s1 != null)
+                s1.stop(2);
+            if (s2 != null)
+                s2.stop(2);
+            if (executor != null)
+                executor.shutdown ();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/Test12.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test12.java	Mon Jun 29 13:10:33 2009 +0100
@@ -85,9 +85,12 @@
             System.out.println ("OK");
         } finally {
             delay();
-            s1.stop(2);
-            s2.stop(2);
-            executor.shutdown ();
+            if (s1 != null)
+                s1.stop(2);
+            if (s2 != null)
+                s2.stop(2);
+            if (executor != null)
+                executor.shutdown ();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/Test13.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test13.java	Mon Jun 29 13:10:33 2009 +0100
@@ -81,9 +81,12 @@
             System.out.println ("OK");
         } finally {
             delay();
-            s1.stop(2);
-            s2.stop(2);
-            executor.shutdown ();
+            if (s1 != null)
+                s1.stop(2);
+            if (s2 != null)
+                s2.stop(2);
+            if (executor != null)
+                executor.shutdown ();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/Test3.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test3.java	Mon Jun 29 13:10:33 2009 +0100
@@ -62,8 +62,10 @@
             System.out.println ("OK");
         } finally {
             delay();
-            server.stop(2);
-            exec.shutdown();
+            if (server != null)
+                server.stop(2);
+            if (exec != null)
+                exec.shutdown();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/Test4.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test4.java	Mon Jun 29 13:10:33 2009 +0100
@@ -60,8 +60,10 @@
             System.out.println ("OK");
         } finally {
             delay();
-            server.stop(2);
-            exec.shutdown();
+            if (server != null)
+                server.stop(2);
+            if (exec != null)
+                exec.shutdown();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/Test5.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test5.java	Mon Jun 29 13:10:33 2009 +0100
@@ -61,8 +61,10 @@
             System.out.println ("OK");
         } finally {
             delay ();
-            server.stop(2);
-            exec.shutdown();
+            if (server != null)
+                server.stop(2);
+            if (exec != null)
+                exec.shutdown();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/Test9.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test9.java	Mon Jun 29 13:10:33 2009 +0100
@@ -97,9 +97,12 @@
             System.out.println ("OK");
         } finally {
             delay();
-            s1.stop(2);
-            s2.stop(2);
-            executor.shutdown ();
+            if (s1 != null)
+                s1.stop(2);
+            if (s2 != null)
+                s2.stop(2);
+            if (executor != null)
+                executor.shutdown ();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/Test9a.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/Test9a.java	Mon Jun 29 13:10:33 2009 +0100
@@ -92,8 +92,10 @@
             System.out.println ("OK");
         } finally {
             delay();
-            server.stop(2);
-            executor.shutdown ();
+            if (server != null)
+                server.stop(2);
+            if (executor != null)
+                executor.shutdown();
         }
     }
 
--- a/jdk/test/com/sun/net/httpserver/TestLogging.java	Thu Jun 25 17:01:56 2009 -0400
+++ b/jdk/test/com/sun/net/httpserver/TestLogging.java	Mon Jun 29 13:10:33 2009 +0100
@@ -89,8 +89,10 @@
             System.out.println ("OK");
         } finally {
             delay();
-            s1.stop(2);
-            executor.shutdown ();
+            if (s1 != null)
+                s1.stop(2);
+            if (executor != null)
+                executor.shutdown();
         }
     }
 }