diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-06-13 09:21:52 +0200 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-06-13 09:21:52 +0200 |
commit | ab65cbdd5887a1ea4b4e96db044584e347265f9e (patch) | |
tree | 0bebb7085ab6874eb92536e83c495f9468965497 | |
parent | 89597d34eec7cab349a1c00a5a2bd85795b9a8f4 (diff) | |
download | aspectj-ab65cbdd5887a1ea4b4e96db044584e347265f9e.tar.gz aspectj-ab65cbdd5887a1ea4b4e96db044584e347265f9e.zip |
Add null checks for Shadow.getResolvedSignature()
Fixes #243.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r-- | org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java index f6c7b7bd8..9e8a2ceec 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java @@ -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"; |