Skip to content

Commit

Permalink
Prevent annotations from being scanned on class init methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed May 22, 2019
1 parent 2c94ee1 commit e8bed54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e8bed54

Please sign in to comment.