From 41a216c75b5dc8833276b505303e5606360fc37d Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Sun, 18 Dec 2016 18:01:16 -0800 Subject: [PATCH] 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/jdk/test/java/rmi/registry/reexport/Reexport.java b/jdk/test/java/rmi/registry/reexport/Reexport.java index a0c9707a74a..1034cad1903 100644 --- a/jdk/test/java/rmi/registry/reexport/Reexport.java +++ b/jdk/test/java/rmi/registry/reexport/Reexport.java @@ -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 @@ public class Reexport { 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 @@ public class Reexport { 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:");