RFR of JDK-8171133: java/rmi/registry/reexport/Reexport.java, there is a missing case check in createReg(..)

Hamlin Li huaming.li at oracle.com
Thu Dec 15 03:19:37 UTC 2016


Would you please review the below patch?

bug: https://bugs.openjdk.java.net/browse/JDK-8171133
webrev: http://cr.openjdk.java.net/~mli/8171133/webrev.00/

java/rmi/registry/reexport/Reexport.java, there is a missing case check 
in createReg(..): if LocateRegistry.createRegistry(port) return null 
when port is in use.

Thank you
-Hamlin
------------------------------------------------------------------------
diff -r ddd192238fcb test/java/rmi/registry/reexport/Reexport.java
--- a/test/java/rmi/registry/reexport/Reexport.java    Tue Dec 13 
18:47:23 2016 -0800
+++ b/test/java/rmi/registry/reexport/Reexport.java    Wed Dec 14 
19:06:40 2016 -0800
@@ -105,6 +105,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:");



More information about the core-libs-dev mailing list