changeset 401:27d87f0031bf

7195779: javax/management/remote/mandatory/threads/ExecutorTest.java fails intermittently, NPE in tie class Reviewed-by: alanb, coffeys Contributed-by: jaroslav.bachorik@oracle.com
author alanb
date Fri, 05 Oct 2012 15:08:10 +0100
parents 18462a19f7bd
children d9c1dab1515b 679e8ad9874f
files src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java	Thu Sep 20 13:44:07 2012 -0700
+++ b/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java	Fri Oct 05 15:08:10 2012 +0100
@@ -1631,7 +1631,7 @@
 
         // Write data members...
         p.pln();
-        p.pln("private " + getName(theType) + " target = null;");
+        p.pln("volatile private " + getName(theType) + " target = null;");
         p.pln();
 
         // Write the ids...
@@ -1695,6 +1695,10 @@
 
         if (remoteMethods.length > 0) {
             p.plnI("try {");
+            p.pln(getName(theType) + " target = this.target;");
+            p.plnI("if (target == null) {");
+            p.pln("throw new java.io.IOException();");
+            p.pOln("}");
             p.plnI(idExtInputStream + " "+in+" = ");
             p.pln("(" + idExtInputStream + ") "+_in+";");
             p.pO();