InnerNamedConstant_2.java revision 0
0N/A * @test /nodynamiccopyright/ 0N/A * @bug 4095568 4277286 4785453 0N/A * @summary Verify rejection of illegal static variables in inner classes. 0N/A * @author William Maddox (maddox) 0N/A * @run shell InnerNamedConstant_2.sh 0N/A static int x =
1;
// OK - class is top-level 0N/A static final int y = x *
5;
// OK - class is top-level 0N/A static final String z;
// OK - class is top-level 0N/A static int x =
1;
// ERROR - static not final 0N/A static final String z;
// ERROR - static blank final 0N/A z =
"foobar";
// Error may be reported here. See 4278961. 0N/A // This case must go in a separate class, as otherwise the detection 0N/A // of the error is suppressed as a result of recovery from the other 0N/A static final int y =
Inner1.x *
5;
// ERROR - initializer not constant