8023326: [TESTBUG] java/net/CookieHandler/LocalHostCookie.java misplaced try/finally
authormsheppar
Fri, 06 Sep 2013 15:00:59 +0100
changeset 19826 460110102fd4
parent 19825 a7e79bc2e437
child 19827 082c76535c1f
8023326: [TESTBUG] java/net/CookieHandler/LocalHostCookie.java misplaced try/finally Summary: amended test to be more robust to set of potential exceptions thrown Reviewed-by: chegar, khazra
jdk/test/java/net/CookieHandler/LocalHostCookie.java
--- a/jdk/test/java/net/CookieHandler/LocalHostCookie.java	Mon Sep 09 13:59:51 2013 +0200
+++ b/jdk/test/java/net/CookieHandler/LocalHostCookie.java	Fri Sep 06 15:00:59 2013 +0100
@@ -72,7 +72,9 @@
                 }
             }
         } finally {
-            s.stopServer();
+            if (s != null) {
+                s.stopServer();
+            }
         }
     }
 
@@ -96,7 +98,9 @@
         }
 
         public void stopServer() {
-            server.stop(0);
+            if (server != null) {
+                server.stop(0);
+            }
         }
     }