changeset 16345:3cf0c2395ab9

8171133: java/rmi/registry/reexport/Reexport.java, there is a missing case check in createReg(..) Reviewed-by: rriggs
author mli
date Sun, 18 Dec 2016 18:01:16 -0800
parents 90fbc6050458
children 692939dada03
files test/java/rmi/registry/reexport/Reexport.java
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/rmi/registry/reexport/Reexport.java	Sun Dec 18 15:37:45 2016 +0100
+++ b/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:");