JDK-8197445: Implementation of JEP 181: Nest-Based Access Control
Problem. Closely-related classes sometimes need to share access private ... The reflection API of <code>java.lang.Class</code> is enhanced to support ...
Problem. Closely-related classes sometimes need to share access private ... The reflection API of <code>java.lang.Class</code> is enhanced to support ...
Now, with Java1.5, Comparable is a generic type. Thus, after genericification, the above source code line, should read.STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Compile the provided source code (e.g.: with "javac com/mn/tools/test/bugs/java/GenericArrayTest2.java").
GenericTest.java:6: error: array required, but CAP#1 found return foo.call()[0]Last worked in version 5.0. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Attempt to compile the source code included with this report.
The workaround is of course simple: Dont make your fields public. Unfortunately this is difficult when using software that is affected by this bug and for which no source code is available. It simply breaks when changing from Java 6 to Java 7 without giving any error messages.
Javac is internally using a 'compound type' and displaying that in error messages.STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Enter the code in netbeans IDE. Look at the error message and its description of the type of the ternary expression.