JDK-4030374 - Java Issue Tracker
Feb 5, 1997 ... Because of verifier limitations, the compiler cannot arrange to initialize synthetic fields like this$0 and val$array before the superclass ...
Feb 5, 1997 ... Because of verifier limitations, the compiler cannot arrange to initialize synthetic fields like this$0 and val$array before the superclass ...
Oracle Java is the #1 programming language and development platform. It reduces costs, shortens development timeframes, drives innovation, and improves application services.
Collection.toArray() is specified to return an object of type Object[], but since arrays are covariant, that requirement is met by any array of a subtype of Object, for example, String[]. It's subtle, but it's clearly, if not explicitly, a bug to return an array of a subtype. See JDK-6260652.
" public String getCanonicalName() "Returns the canonical name of the ... " In other words, a common pattern for methods in java.lang.Class is to ...
The Collection.toArray() method returns Object[] but it doesn't make clear that the runtime type of the returned array must be Object[]. (Oddly, that is specified in toArray(T[]) which is in the wrong place.)
2 is the default value, The change to 17 is lost. ERROR MESSAGES/STACK TRACES THAT OCCUR : The example doesnt produce any error messages.Override public String toString() {. return Arrays.toString(arr)