File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
test/jdk/javax/management Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2008, 2015 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2008, 2023 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -123,10 +123,13 @@ public void run(Map<String, Object> args) {
123123 } finally {
124124 try {
125125 // Close JMX Connector Client
126- cc .close ();
126+ if (cc != null ) {
127+ cc .close ();
128+ }
127129 // Stop connertor server
128- cs .stop ();
129-
130+ if (cs != null ) {
131+ cs .stop ();
132+ }
130133 } catch (Exception e ) {
131134 Utils .printThrowable (e , true );
132135 throw new RuntimeException (
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2017, 2018 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2017, 2023 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -200,6 +200,12 @@ private JMXServiceURL createServerSide(boolean useHash)
200200 return cs .getAddress ();
201201 }
202202
203+ private void stopServerSide () throws IOException {
204+ if (cs != null ) {
205+ cs .stop ();
206+ }
207+ }
208+
203209 @ Test
204210 public void testClearTextPasswordFile () throws IOException {
205211 Boolean [] bvals = new Boolean []{true , false };
@@ -217,7 +223,7 @@ public void testClearTextPasswordFile() throws IOException {
217223 }
218224 Assert .assertEquals (isPasswordFileHashed (), bval );
219225 } finally {
220- cs . stop ();
226+ stopServerSide ();
221227 }
222228 }
223229 }
@@ -241,7 +247,7 @@ public void testReadOnlyPasswordFile() throws IOException {
241247 }
242248 Assert .assertEquals (isPasswordFileHashed (), false );
243249 } finally {
244- cs . stop ();
250+ stopServerSide ();
245251 }
246252 }
247253 }
@@ -263,7 +269,7 @@ public void testHashedPasswordFile() throws IOException {
263269 }
264270 }
265271 } finally {
266- cs . stop ();
272+ stopServerSide ();
267273 }
268274 }
269275 }
@@ -400,7 +406,7 @@ public void testPasswordChange() throws IOException {
400406 }
401407 }
402408 } finally {
403- cs . stop ();
409+ stopServerSide ();
404410 }
405411 }
406412
You can’t perform that action at this time.
0 commit comments