-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: 11, 15
-
Component/s: hotspot
-
b29
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8248285 | 16 | Tom Rodriguez | P3 | Resolved | Fixed | b04 |
| JDK-8250097 | 15.0.2 | Tom Rodriguez | P3 | Resolved | Fixed | b01 |
| JDK-8250396 | 15.0.1 | Tom Rodriguez | P3 | Resolved | Fixed | b03 |
| JDK-8250263 | 11.0.10-oracle | Tom Rodriguez | P3 | Resolved | Fixed | b01 |
| JDK-8249047 | 11.0.9 | Tom Rodriguez | P3 | Resolved | Fixed | b01 |
This happens when the `type` implements an interface with a default method whose return type is missing from the classpath:
```
interface MissingInterface {
}
class MissingInterfaceImpl implements MissingInterface {
}
interface SomeInterface {
default MissingInterface someMethod() {
return new MissingInterfaceImpl();
}
}
class Wrapper {
SomeInterface getSomeInterface() {
return new SomeInterface() {
};
}
}
```
The use case for this is to call `ResolvedJavaType.getDeclaredMethod()` from GraalVM Native Image to check if an interface declares any default methods. When `getDeclaredMethod()` is invoked there is no reason to trigger linking of the class so no call to `link_class` should be necessary.
More over, HotSpot already stores a "has default method" flag for interfaces. It would be ideal if JVMCI can expose this.
```
interface MissingInterface {
}
class MissingInterfaceImpl implements MissingInterface {
}
interface SomeInterface {
default MissingInterface someMethod() {
return new MissingInterfaceImpl();
}
}
class Wrapper {
SomeInterface getSomeInterface() {
return new SomeInterface() {
};
}
}
```
The use case for this is to call `ResolvedJavaType.getDeclaredMethod()` from GraalVM Native Image to check if an interface declares any default methods. When `getDeclaredMethod()` is invoked there is no reason to trigger linking of the class so no call to `link_class` should be necessary.
More over, HotSpot already stores a "has default method" flag for interfaces. It would be ideal if JVMCI can expose this.
- backported by
-
JDK-8248285 [JVMCI] `ResolvedJavaType.getDeclaredMethod()` can throw NoClassDefFoundError.
-
- Resolved
-
-
JDK-8249047 [JVMCI] `ResolvedJavaType.getDeclaredMethod()` can throw NoClassDefFoundError.
-
- Resolved
-
-
JDK-8250097 [JVMCI] `ResolvedJavaType.getDeclaredMethod()` can throw NoClassDefFoundError.
-
- Resolved
-
-
JDK-8250263 [JVMCI] `ResolvedJavaType.getDeclaredMethod()` can throw NoClassDefFoundError.
-
- Resolved
-
-
JDK-8250396 [JVMCI] `ResolvedJavaType.getDeclaredMethod()` can throw NoClassDefFoundError.
-
- Resolved
-