Skip to content

Commit 4099598

Browse files
committed
Avoid NoClassDefFoundError in ReflectUtil.
1 parent fd32ce3 commit 4099598

File tree

1 file changed

+8
-1
lines changed
  • web-image/src/com.oracle.svm.hosted.webimage/src/com/oracle/svm/hosted/webimage/util

1 file changed

+8
-1
lines changed

web-image/src/com.oracle.svm.hosted.webimage/src/com/oracle/svm/hosted/webimage/util/ReflectUtil.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,15 @@ private static Optional<Method> singleAbstractMethodForInterface(Class<?> javaIn
7272
return Optional.empty();
7373
}
7474

75+
Method[] methods;
76+
try {
77+
methods = javaInterface.getMethods();
78+
} catch (NoClassDefFoundError e) {
79+
return Optional.empty();
80+
}
81+
7582
Method sam = null;
76-
for (final Method method : javaInterface.getMethods()) {
83+
for (final Method method : methods) {
7784
if (OBJECT_METHODS.contains(method)) {
7885
// Skip the methods from the Object class.
7986
continue;

0 commit comments

Comments
 (0)