From: mwebster Date: Wed, 12 Jul 2006 14:27:55 +0000 (+0000) Subject: Fix for Bug 150254 "Provide context for LTW verbose messages" (WeavingAdaptorMessageH... X-Git-Tag: PRE_PIPELINE~43 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b1024db14f7290378784988e14dffd2def5c251f;p=aspectj.git Fix for Bug 150254 "Provide context for LTW verbose messages" (WeavingAdaptorMessageHandler.render()) --- diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java index 40dc168ad..1a637cfbc 100644 --- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -79,7 +79,6 @@ public class WeavingAdaptor { protected Map generatedClasses = new HashMap(); /* String -> UnwovenClassFile */ protected WeavingAdaptor () { - createMessageHandler(); } @@ -162,7 +161,7 @@ public class WeavingAdaptor { registerAspectLibraries(aspectPath); } - private void createMessageHandler() { + protected void createMessageHandler() { messageHolder = new WeavingAdaptorMessageHandler(new PrintWriter(System.err)); messageHandler = messageHolder; if (verbose) messageHandler.dontIgnore(IMessage.INFO); @@ -360,6 +359,10 @@ public class WeavingAdaptor { protected boolean error (String message) { return MessageUtil.error(messageHandler,message); } + + protected String getContextId () { + return "WeavingAdaptor"; + } /** * Dump the given bytcode in _dump/... (dev mode) @@ -458,6 +461,10 @@ public class WeavingAdaptor { accumulating = false; messages.clear(); } + + protected String render(IMessage message) { + return "[" + getContextId() + "] " + super.render(message); + } } private class WeavingClassFileProvider implements IClassFileProvider {