aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime
diff options
context:
space:
mode:
authoravasseur <avasseur>2005-05-17 08:29:18 +0000
committeravasseur <avasseur>2005-05-17 08:29:18 +0000
commit33c5c59a9e5ef8378f8695b905ceddf03f685c2b (patch)
tree8b500376a111312b405e1777feaeb026c1b82eb5 /loadtime
parentbe5b8333d32e6efc02a73f4a83fbf10f1c5a9018 (diff)
downloadaspectj-33c5c59a9e5ef8378f8695b905ceddf03f685c2b.tar.gz
aspectj-33c5c59a9e5ef8378f8695b905ceddf03f685c2b.zip
aspects are reweavable by default, fixed issue in (AJC + LTW + Inlining + @AJ)
Diffstat (limited to 'loadtime')
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/Aj.java11
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java3
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/Options.java15
3 files changed, 24 insertions, 5 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
index a087c5c81..0962fefbe 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
@@ -14,6 +14,7 @@ package org.aspectj.weaver.loadtime;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.WeakHashMap;
@@ -99,8 +100,14 @@ public class Aj implements ClassPreProcessor {
new Integer(bytes.length)
}
);
- } catch (Throwable t) {
- t.printStackTrace();
+ } catch (InvocationTargetException e) {
+ if (e.getTargetException() instanceof LinkageError) {
+ ;//is already defined (happens for X$ajcMightHaveAspect interfaces since aspects are reweaved)
+ } else {
+ e.printStackTrace();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
index a08847a6d..f41041332 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
@@ -121,6 +121,9 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
URL xml = (URL) xmls.nextElement();
definitions.add(DocumentParser.parse(xml));
}
+
+ // still go thru if definitions is empty since we will configure
+ // the default message handler in there
registerOptions(weaver, loader, definitions);
registerAspectExclude(weaver, loader, definitions);
registerAspects(weaver, loader, definitions);
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Options.java b/loadtime/src/org/aspectj/weaver/loadtime/Options.java
index 387eca2bf..5ab7d5e9d 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/Options.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/Options.java
@@ -44,13 +44,14 @@ public class Options {
//FIXME dump option - dump what - dump before/after ?
public static WeaverOption parse(String options, ClassLoader laoder) {
+ if (LangUtil.isEmpty(options)) {
+ return new WeaverOption();
+ }
// the first option wins
List flags = LangUtil.anySplit(options, " ");
Collections.reverse(flags);
WeaverOption weaverOption = new WeaverOption();
- weaverOption.messageHandler = new DefaultMessageHandler();//default
-
// do a first round on the message handler since it will report the options themselves
for (Iterator iterator = flags.iterator(); iterator.hasNext();) {
@@ -99,7 +100,7 @@ public class Options {
} else {
weaverOption.messageHandler.handleMessage(
new Message(
- "Cannot configure weaver with option " + arg + ": unknown option",
+ "Cannot configure weaver with option '" + arg + "': unknown option",
IMessage.WARNING,
null,
null
@@ -132,5 +133,13 @@ public class Options {
boolean noInline;
boolean showWeaveInfo;
IMessageHandler messageHandler;
+
+ public WeaverOption() {
+ messageHandler = new DefaultMessageHandler();//default
+
+ //temp alex
+ messageHandler.dontIgnore(IMessage.WEAVEINFO);
+ messageHandler.dontIgnore(IMessage.INFO);
+ }
}
}