]> source.dussan.org Git - aspectj.git/commitdiff
- IMessage-based compiler messages
authorwisberg <wisberg>
Wed, 30 Apr 2003 02:38:29 +0000 (02:38 +0000)
committerwisberg <wisberg>
Wed, 30 Apr 2003 02:38:29 +0000 (02:38 +0000)
- better toString for logging message lists

ajde/testsrc/org/aspectj/ajde/NullIdeTaskListManager.java

index d127220eb07ff5d8079a84ccaa2ba8b6987110e2..2664088bf8303eca69b023e7d3ae4ac2c7d3ab0f 100644 (file)
@@ -27,8 +27,15 @@ public class NullIdeTaskListManager implements TaskListManager {
        
        List sourceLineTasks = new ArrayList();
 
-    public void addSourcelineTask(String message, ISourceLocation sourceLocation, IMessage.Kind kind) {
-       sourceLineTasks.add(new SourceLineTask(message,sourceLocation,kind));
+    public void addSourcelineTask(
+        String message,
+        ISourceLocation sourceLocation,
+        IMessage.Kind kind) {
+        addSourcelineTask(new Message(message, kind, null, sourceLocation));
+    }
+    
+    public void addSourcelineTask(IMessage message) {
+       sourceLineTasks.add(new SourceLineTask(message));
 //     System.out.println("> added sourceline task: " + message + ", file: " + sourceLocation.getSourceFile().getAbsolutePath()
 //             + ": " +  sourceLocation.getLine());
     }
@@ -57,11 +64,21 @@ public class NullIdeTaskListManager implements TaskListManager {
                public ISourceLocation location;
                public IMessage.Kind kind;
                
-               public SourceLineTask(String m,ISourceLocation l,IMessage.Kind k) {
-                       message = m;
-                       location = l;
-                       kind = k;
+               public SourceLineTask(IMessage m) {
+                       message = m.getMessage();
+                       location = m.getISourceLocation();
+                       kind = m.getKind();
                }
+        public String toString() {
+            String loc = "<no location";
+            if (null != location) {
+                loc = location.getSourceFile() + ":" + location.getLine();
+            }
+            return "SourceLineTask [" + message 
+                + ", " + loc
+                + ", " + kind
+                + "]";
+        }
        }
 }