8129499: Structure of java/rmi/activation/rmidViaInheritedChannel tests masks exception
authorbpb
Mon, 22 Jun 2015 13:30:21 -0700
changeset 31247 6423385b99fe
parent 31246 dfc58fd4feec
child 31248 0006a0e47a04
child 31249 8bfa589f4c85
8129499: Structure of java/rmi/activation/rmidViaInheritedChannel tests masks exception Summary: Check for rmid == null before dereferencing the variable. Reviewed-by: rriggs, chegar
jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java
jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
--- a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java	Sat Jun 20 10:03:42 2015 -0400
+++ b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java	Mon Jun 22 13:30:21 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -126,7 +126,9 @@
             if (obj != null) {
                 UnicastRemoteObject.unexportObject(obj, true);
             }
-            rmid.cleanup();
+            if (rmid != null) {
+                rmid.cleanup();
+            }
         }
     }
 
--- a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java	Sat Jun 20 10:03:42 2015 -0400
+++ b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java	Mon Jun 22 13:30:21 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -125,7 +125,9 @@
             if (obj != null) {
                 UnicastRemoteObject.unexportObject(obj, true);
             }
-            rmid.cleanup();
+            if (rmid != null) {
+                rmid.cleanup();
+            }
         }
     }