8171133: java/rmi/registry/reexport/Reexport.java, there is a missing case check in createReg(..)
authormli
Sun, 18 Dec 2016 18:01:16 -0800
changeset 42760 902ae4f76a3e
parent 42759 0ff64a5b3824
child 42761 c3798108e1ad
8171133: java/rmi/registry/reexport/Reexport.java, there is a missing case check in createReg(..) Reviewed-by: rriggs
jdk/test/java/rmi/registry/reexport/Reexport.java
--- a/jdk/test/java/rmi/registry/reexport/Reexport.java	Sun Dec 18 15:37:45 2016 +0100
+++ b/jdk/test/java/rmi/registry/reexport/Reexport.java	Sun Dec 18 18:01:16 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,10 +67,6 @@
             System.err.println("Creating duplicate registry, this should fail...");
             reg = createReg(true, regPort);
 
-            if (reg != null) {
-                TestLibrary.bomb("failed was able to duplicate the registry?!?");
-            }
-
             // Kill the first registry.
             System.err.println("Bringing down the first registry");
             try {
@@ -105,6 +101,9 @@
 
         try {
             reg = LocateRegistry.createRegistry(port);
+            if (remoteOk) {
+                TestLibrary.bomb("Remote registry is up, an Exception is expected!");
+            }
         } catch (Throwable e) {
             if (remoteOk) {
                 System.err.println("EXPECTING PORT IN USE EXCEPTION:");