diff --git a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisUniverse.java b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisUniverse.java index 445fb7225a1c..d0707e0867e9 100644 --- a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisUniverse.java +++ b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisUniverse.java @@ -401,7 +401,7 @@ public JavaMethod lookupAllowUnresolved(JavaMethod rawMethod) { } private AnalysisMethod createMethod(ResolvedJavaMethod method) { - if (!platformSupported(method)) { + if (!method.isClassInitializer() && !platformSupported(method)) { throw new UnsupportedFeatureException("Method " + method.format("%H.%n(%p)" + " is not available in this platform.")); } if (sealed) { diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/cenum/CEnumCallWrapperSubstitutionProcessor.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/cenum/CEnumCallWrapperSubstitutionProcessor.java index b39351e464fc..eb3382c55b7b 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/cenum/CEnumCallWrapperSubstitutionProcessor.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/cenum/CEnumCallWrapperSubstitutionProcessor.java @@ -51,8 +51,8 @@ public CEnumCallWrapperSubstitutionProcessor() { @Override public ResolvedJavaMethod lookup(ResolvedJavaMethod method) { - if (GuardedAnnotationAccess.isAnnotationPresent(method, CEnumLookup.class) || - GuardedAnnotationAccess.isAnnotationPresent(method, CEnumValue.class)) { + if (!method.isClassInitializer() && (GuardedAnnotationAccess.isAnnotationPresent(method, CEnumLookup.class) || + GuardedAnnotationAccess.isAnnotationPresent(method, CEnumValue.class))) { return callWrappers.computeIfAbsent(method, v -> new CEnumCallWrapperMethod(nativeLibraries, v)); } else { return method;