]> source.dussan.org Git - aspectj.git/commitdiff
Add null checks for Shadow.getResolvedSignature()
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Tue, 13 Jun 2023 07:21:52 +0000 (09:21 +0200)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Tue, 13 Jun 2023 07:21:52 +0000 (09:21 +0200)
Fixes #243.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java

index f6c7b7bd8ce799c6c27536044cb137fca30bd4eb..9e8a2ceec25abc0ada9dc56532ab2c3de053c91a 100644 (file)
@@ -178,10 +178,11 @@ public abstract class Shadow {
                if (isShadowForMonitor()) {
                        return UnresolvedType.ARRAY_WITH_JUST_OBJECT;
                }
+               ResolvedMember resolvedSig = getResolvedSignature();
                if (getKind() == FieldSet) {
-                       return new UnresolvedType[] { getResolvedSignature().getGenericReturnType() };
+                       return new UnresolvedType[] { resolvedSig == null ? null : resolvedSig.getGenericReturnType() };
                }
-               return getResolvedSignature().getGenericParameterTypes();
+               return resolvedSig == null ? null : resolvedSig.getGenericParameterTypes();
        }
 
        public UnresolvedType getArgType(int arg) {
@@ -282,7 +283,8 @@ public abstract class Shadow {
                } else if (kind == SynchronizationLock || kind == SynchronizationUnlock) {
                        return UnresolvedType.VOID;
                }
-               return getResolvedSignature().getGenericReturnType();
+               ResolvedMember resolvedSig = getResolvedSignature();
+               return resolvedSig == null ? null : resolvedSig.getGenericReturnType();
        }
 
        public static String METHOD_EXECUTION = "method-execution";