From b1024db14f7290378784988e14dffd2def5c251f Mon Sep 17 00:00:00 2001 From: mwebster Date: Wed, 12 Jul 2006 14:27:55 +0000 Subject: [PATCH] Fix for Bug 150254 "Provide context for LTW verbose messages" (WeavingAdaptorMessageHandler.render()) --- .../src/org/aspectj/weaver/tools/WeavingAdaptor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 { -- 2.39.5