]> source.dussan.org Git - aspectj.git/commitdiff
Fix for Bug 150254 "Provide context for LTW verbose messages" (WeavingAdaptorMessageH...
authormwebster <mwebster>
Wed, 12 Jul 2006 14:27:55 +0000 (14:27 +0000)
committermwebster <mwebster>
Wed, 12 Jul 2006 14:27:55 +0000 (14:27 +0000)
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java

index 40dc168ada3f7469142ed379a0e80651168ff2df..1a637cfbc8b6312a4d0b5165abd9b76a477cd196 100644 (file)
@@ -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 {