JDK-8161256: general data in constant pools - Java Issue Tracker
Jul 12, 2016 ... ... string argument.) As with `invokedynamic ... method would return a value which would be immediately converted to the required type.
Jul 12, 2016 ... ... string argument.) As with `invokedynamic ... method would return a value which would be immediately converted to the required type.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Compile to sample program 2. Run java KeyReader 3. Press Control+x. EXPECTED VERSUS ACTUAL BEHAVIOR : The method should return a string that can be passed to KeyStroke.getKeyStroke.
The following discussion gives two examplesIf you change the return type of all clone() methods in the Java library to the right type, it seem to me that it would not break the backward compatibility, except in the case of obvious programming error.
fails with: Test.java:11: error: incompatible types: cannot infer type-variable(s) T,U.type-variable: CAP#1 extends String from capture of ? extends String 1 error. but if the lambda is implicit: e -> e.trim(), it compiles just fine.
Description. 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.