7195779: javax/management/remote/mandatory/threads/ExecutorTest.java fails intermittently, NPE in tie class

Fri, 05 Oct 2012 15:08:10 +0100

author
alanb
date
Fri, 05 Oct 2012 15:08:10 +0100
changeset 402
27d87f0031bf
parent 398
18462a19f7bd
child 403
d9c1dab1515b
child 409
679e8ad9874f

7195779: javax/management/remote/mandatory/threads/ExecutorTest.java fails intermittently, NPE in tie class
Reviewed-by: alanb, coffeys
Contributed-by: jaroslav.bachorik@oracle.com

src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java	Thu Sep 20 13:44:07 2012 -0700
     1.2 +++ b/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java	Fri Oct 05 15:08:10 2012 +0100
     1.3 @@ -1631,7 +1631,7 @@
     1.4  
     1.5          // Write data members...
     1.6          p.pln();
     1.7 -        p.pln("private " + getName(theType) + " target = null;");
     1.8 +        p.pln("volatile private " + getName(theType) + " target = null;");
     1.9          p.pln();
    1.10  
    1.11          // Write the ids...
    1.12 @@ -1695,6 +1695,10 @@
    1.13  
    1.14          if (remoteMethods.length > 0) {
    1.15              p.plnI("try {");
    1.16 +            p.pln(getName(theType) + " target = this.target;");
    1.17 +            p.plnI("if (target == null) {");
    1.18 +            p.pln("throw new java.io.IOException();");
    1.19 +            p.pOln("}");
    1.20              p.plnI(idExtInputStream + " "+in+" = ");
    1.21              p.pln("(" + idExtInputStream + ") "+_in+";");
    1.22              p.pO();

mercurial