changeset 16211:f22652e8f85f

8081390: javax/management/remote/mandatory/connection/RMIConnector_NPETest.java may leave orphaned processes Reviewed-by: rriggs
author xiaofeya
date Tue, 06 Dec 2016 17:49:44 -0800
parents 10b191e1793b
children 0ceaa5dc89ec
files test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java	Tue Dec 06 17:53:22 2016 -0800
+++ b/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java	Tue Dec 06 17:49:44 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -43,12 +43,12 @@
 public class RMIConnector_NPETest {
     public static void main(String argv[]) throws Exception {
         RMID rmid = RMID.createRMID();
-        rmid.start();
-        int rmidPort = rmid.getPort();
         Exception failureCause = null;
         RMIConnector agent = null;
 
         try {
+            rmid.start();
+            int rmidPort = rmid.getPort();
             MBeanServer mbs = MBeanServerFactory.createMBeanServer();
             RMIJRMPServerImpl rmiserver = new RMIJRMPServerImpl(rmidPort, null, null, null);
             rmiserver.setMBeanServer(mbs);
@@ -75,3 +75,4 @@
 
     }
 }
+