diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-04-10 09:40:41 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-04-10 09:40:41 +0700 |
commit | 238af52f840946000bf102e7fde72a426de4a402 (patch) | |
tree | f1ba100cdba57b892720aade1f8613468512221f | |
parent | 1ecda93436b7e4e3736601a648a9f55ad19d67e0 (diff) | |
download | aspectj-238af52f840946000bf102e7fde72a426de4a402.tar.gz aspectj-238af52f840946000bf102e7fde72a426de4a402.zip |
BcelWorld.reportMatch: handle 'kind.getName() == null' correctly
Fixes #153.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r-- | weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java index 7c4509e71..f498c37c5 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java @@ -130,11 +130,13 @@ public class BcelWorld extends World implements Repository { @Override public void reportMatch(ShadowMunger munger, Shadow shadow) { if (getCrossReferenceHandler() != null) { - getCrossReferenceHandler().addCrossReference(munger.getSourceLocation(), // What is being applied - shadow.getSourceLocation(), // Where is it being applied - determineRelKind(munger).getName(), // What kind of advice? - ((Advice) munger).hasDynamicTests() // Is a runtime test being stuffed in the code? - ); + final IRelationship.Kind kind = determineRelKind(munger); + getCrossReferenceHandler().addCrossReference( + munger.getSourceLocation(), // What is being applied? + shadow.getSourceLocation(), // Where is it being applied? + kind == null ? null : kind.getName(), // What kind of advice? + ((Advice) munger).hasDynamicTests() // Is a runtime test being stuffed in the code? + ); } if (!getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) { |