aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime/src
diff options
context:
space:
mode:
authoravasseur <avasseur>2005-05-10 15:44:11 +0000
committeravasseur <avasseur>2005-05-10 15:44:11 +0000
commit83655ff47c1af1ca58c8043626799e0483d5acd4 (patch)
tree0cd02ea9863cbbb759ab0df465dd60a584855b8f /loadtime/src
parent2c4f9d292a521703642169d8c066792d0e0802f5 (diff)
downloadaspectj-83655ff47c1af1ca58c8043626799e0483d5acd4.tar.gz
aspectj-83655ff47c1af1ca58c8043626799e0483d5acd4.zip
fix 75442 thru lateTypeMungers, currently @AJaspectOf and perObject are lateTypeMungers. new LTW tests, some fix in the LTW test error reporting
Diffstat (limited to 'loadtime/src')
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/Aj.java4
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/DefaultMessageHandler.java55
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/Options.java33
3 files changed, 60 insertions, 32 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
index 4bb83cbad..a087c5c81 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java
@@ -55,6 +55,8 @@ public class Aj implements ClassPreProcessor {
__dump(className, weaved);
return weaved;
} catch (Throwable t) {
+ //FIXME AV wondering if we should have the option to fail (throw runtime exception) here
+ // would make sense at least in test f.e. see TestHelper.handleMessage()
t.printStackTrace();
return bytes;
}
@@ -110,7 +112,7 @@ public class Aj implements ClassPreProcessor {
* @throws Throwable
*/
static void __dump(String name, byte[] b) throws Throwable {
- if (true) return;//FIXME AV have an option
+ //if (true) return;//FIXME AV have an option
String className = name.replace('.', '/');
final File dir;
if (className.indexOf('/') > 0) {
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/DefaultMessageHandler.java b/loadtime/src/org/aspectj/weaver/loadtime/DefaultMessageHandler.java
new file mode 100644
index 000000000..e099dee7c
--- /dev/null
+++ b/loadtime/src/org/aspectj/weaver/loadtime/DefaultMessageHandler.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2005 Contributors.
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexandre Vasseur initial implementation
+ *******************************************************************************/
+package org.aspectj.weaver.loadtime;
+
+import org.aspectj.bridge.IMessageHandler;
+import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.AbortException;
+
+/**
+ * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ */
+public class DefaultMessageHandler implements IMessageHandler {
+
+ boolean isVerbose = false;
+ boolean showWeaveInfo = false;
+ boolean showWarn = true;
+
+ public boolean handleMessage(IMessage message) throws AbortException {
+ if (message.getKind().isSameOrLessThan(IMessage.INFO)) {
+ return SYSTEM_OUT.handleMessage(message);
+ } else {
+ return SYSTEM_ERR.handleMessage(message);
+ }
+ }
+
+ public boolean isIgnoring(IMessage.Kind kind) {
+ if (kind.equals(IMessage.WEAVEINFO)) {
+ return !showWeaveInfo;
+ }
+ if (kind.isSameOrLessThan(IMessage.INFO)) {
+ return !isVerbose;
+ }
+ return !showWarn;
+ }
+
+ public void dontIgnore(IMessage.Kind kind) {
+ if (kind.equals(IMessage.WEAVEINFO)) {
+ showWeaveInfo = true;
+ } else if (kind.equals(IMessage.DEBUG)) {
+ isVerbose = true;
+ } else if (kind.equals(IMessage.WARNING)) {
+ showWarn = false;
+ }
+ }
+
+}
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Options.java b/loadtime/src/org/aspectj/weaver/loadtime/Options.java
index c466f9787..387eca2bf 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/Options.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/Options.java
@@ -30,37 +30,6 @@ import java.util.List;
*/
public class Options {
- private static class DefaultMessageHandler implements IMessageHandler {
-
- boolean isVerbose = false;
- boolean showWeaveInfo = false;
- boolean showWarn = true;
-
- public boolean handleMessage(IMessage message) throws AbortException {
- return SYSTEM_OUT.handleMessage(message);
- }
-
- public boolean isIgnoring(IMessage.Kind kind) {
- if (kind.equals(IMessage.WEAVEINFO)) {
- return !showWeaveInfo;
- }
- if (kind.isSameOrLessThan(IMessage.INFO)) {
- return !isVerbose;
- }
- return !showWarn;
- }
-
- public void dontIgnore(IMessage.Kind kind) {
- if (kind.equals(IMessage.WEAVEINFO)) {
- showWeaveInfo = true;
- } else if (kind.equals(IMessage.DEBUG)) {
- isVerbose = true;
- } else if (kind.equals(IMessage.WARNING)) {
- showWarn = false;
- }
- }
- }
-
private final static String OPTION_15 = "-1.5";
private final static String OPTION_lazyTjp = "-XlazyTjp";
private final static String OPTION_noWarn = "-nowarn";
@@ -125,6 +94,8 @@ public class Options {
weaverOption.showWeaveInfo = true;
} else if (arg.equalsIgnoreCase(OPTION_verbose)) {
weaverOption.verbose = true;
+ } else if (arg.startsWith(OPTIONVALUED_messageHolder)) {
+ ;// handled in first round
} else {
weaverOption.messageHandler.handleMessage(
new Message(