changeset 8027:02064634bc88

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
author msheppar
date Fri, 06 Sep 2013 15:00:59 +0100
parents 4afdf10de648
children 4fd7abaf0a5f
files test/java/net/CookieHandler/LocalHostCookie.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/net/CookieHandler/LocalHostCookie.java	Mon Sep 09 13:59:51 2013 +0200
+++ b/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);
+            }
         }
     }