JDK-4030374 - Java Issue Tracker
Feb 5, 1997 ... The solution is probably to have some compiler analysis of the code ... For example, the following program would fail at runtime: <pre> ...
Feb 5, 1997 ... The solution is probably to have some compiler analysis of the code ... For example, the following program would fail at runtime: <pre> ...
404 - Not found. Head back home or try the search bar above!
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.
It's an error in java.lang.String source code which is the same for all JDK distributions.I have created a more simple example class which demonstrates this behaviour very clearly. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : See bug ID 4637640.
A DESCRIPTION OF THE PROBLEM : Direct array element access (within a single line) of a wildcard generic type with an array typed upper bound fails with the following compilation error: GenericTest.java:6: error: array required, but CAP#1 found return foo.call()[0]