aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2016-12-08 08:43:16 -0800
committerAndy Clement <aclement@pivotal.io>2016-12-08 08:43:16 -0800
commitb5df397fa8f28c52bb02e489d0e1f821c0054a48 (patch)
tree85104a336cf8fcbdf513f72b9ec85ebccdf01a1e /weaver
parent821f7d4c71c1025dae6990a65fb9549a8530b1ac (diff)
downloadaspectj-b5df397fa8f28c52bb02e489d0e1f821c0054a48.tar.gz
aspectj-b5df397fa8f28c52bb02e489d0e1f821c0054a48.zip
Adjust from nasty exception to messages
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
index e3e97517a..d534405da 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -215,12 +215,15 @@ public class BcelWeaver {
}
return type;
} else {
- // FIXME AV - better warning upon no such aspect from aop.xml
- RuntimeException ex = new RuntimeException("Cannot register non aspect: " + type.getName() + " , " + aspectName);
- if (trace.isTraceEnabled()) {
- trace.exit("addLibraryAspect", ex);
- }
- throw ex;
+ if (type.isMissing()) {
+ // May not be found if not visible to the classloader that can see the aop.xml during LTW
+ IMessage message = new Message("The specified aspect '"+aspectName+"' cannot be found", null, true);
+ world.getMessageHandler().handleMessage(message);
+ } else {
+ IMessage message = new Message("Cannot register '"+aspectName+"' because the type found with that name is not an aspect", null, true);
+ world.getMessageHandler().handleMessage(message);
+ }
+ return null;
}
}