-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b01
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2193321 | 7 | John Rose | P3 | Closed | Fixed | b94 |
JDK-2197806 | 6u23 | John Rose | P3 | Resolved | Fixed | b01 |
JDK-2199706 | 6u22m | John Rose | P3 | Resolved | Fixed | b01 |
JDK-2197517 | 6u21p | John Rose | P3 | Resolved | Fixed | b03 |
The workaround, therefore, is to load your entire JSR 292 application using -Xbootclasspath/a:myapp.jar.
import java.dyn.*;
import static java.dyn.MethodHandles.*;
import static java.dyn.MethodType.*;
public class BCPBug {
// Local class which appears in method signature;
static class Example { }
static void bcpTypesOnly(Object x) { System.out.println("bcpTypesOnly"); }
static void hasUserType(Example x) { System.out.println("hasUserType"); }
public static void main(String... av) throws Throwable {
Lookup lookup = lookup();
MethodHandle bcpTypesOnly = lookup.findStatic(lookup.lookupClass(), "bcpTypesOnly", methodType(void.class, Object.class));
MethodHandle hasUserType = lookup.findStatic(lookup.lookupClass(), "hasUserType", methodType(void.class, Example.class));
bcpTypesOnly.<void>invokeExact((Object)null);
hasUserType.<void>invokeExact((Example)null); // throws NoClassDefFoundError on BCPBug$Example
}
}
/* Run:
$ $JAVA7X_HOME/bin/javac -d . BCPBug.java
$ $JAVA7X_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -cp . BCPBug
bcpTypesOnly
Exception in thread "main" java.lang.NoClassDefFoundError: BCPBug$Example
at BCPBug.main(BCPBug.java:17)
*/
- backported by
-
JDK-2197517 method handle signatures off the boot class path get linkage errors
- Resolved
-
JDK-2197806 method handle signatures off the boot class path get linkage errors
- Resolved
-
JDK-2199706 method handle signatures off the boot class path get linkage errors
- Resolved
-
JDK-2193321 method handle signatures off the boot class path get linkage errors
- Closed
- duplicates
-
JDK-6924638 MethodHandles.catchException() does not work for user-defined exceptions
- Closed
- relates to
-
JDK-7092712 JSR 292: unloaded invokedynamic call sites can lead to a crash with signature types not on BCP
- Closed
-
JDK-7055941 JSR 292 method handle invocation causes excessive deoptimization for types not on boot class path
- Closed
-
JDK-6990192 VM crashes in ciTypeFlow::get_block_for()
- Closed