]> source.dussan.org Git - aspectj.git/commitdiff
269912: dont build message contexts for messages that will be output in the IDE
authoraclement <aclement>
Wed, 25 Mar 2009 16:19:48 +0000 (16:19 +0000)
committeraclement <aclement>
Wed, 25 Mar 2009 16:19:48 +0000 (16:19 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java

index 15df3fc6e31c536650cc948273d025093835ae95..9f763e26ab48e77560c1e20d67531dc7d167570b 100644 (file)
@@ -1082,7 +1082,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
                                if (unitResult.hasProblems() || unitResult.hasTasks()) {
                                        IProblem[] problems = unitResult.getAllProblems();
                                        for (int i = 0; i < problems.length; i++) {
-                                               IMessage message = EclipseAdapterUtils.makeMessage(unitResult.compilationUnit, problems[i], getBcelWorld());
+                                               IMessage message = EclipseAdapterUtils.makeMessage(unitResult.compilationUnit, problems[i], getBcelWorld(),progressListener);
                                                handler.handleMessage(message);
                                        }
                                }
index d84e2d557b41fc9f272c9a2c1c18549099e85a16..7c92b223ece9ae1c80a3dd26b450558f0a88c24e 100644 (file)
@@ -16,6 +16,7 @@ package org.aspectj.ajdt.internal.core.builder;
 import java.io.File;
 
 import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.IProgressListener;
 import org.aspectj.bridge.ISourceLocation;
 import org.aspectj.bridge.Message;
 import org.aspectj.bridge.SourceLocation;
@@ -107,24 +108,31 @@ public class EclipseAdapterUtils {
 
        /**
         * Extract source location file, start and end lines, and context. Column is not extracted correctly.
+        * @param progressListener 
         * 
         * @return ISourceLocation with correct file and lines but not column.
         */
-       public static ISourceLocation makeSourceLocation(ICompilationUnit unit, IProblem problem) {
+       public static ISourceLocation makeSourceLocation(ICompilationUnit unit, IProblem problem, IProgressListener progressListener) {
                int line = problem.getSourceLineNumber();
                File file = new File(new String(problem.getOriginatingFileName()));
-               String context = makeLocationContext(unit, problem);
-               // XXX 0 column is wrong but recoverable from makeLocationContext
-               return new SourceLocation(file, line, line, 0, context);
+               // cheat here...269912 - don't build the context if under IDE control
+               if (progressListener!=null) {
+                       return new SourceLocation(file, line, line, 0, null);
+               } else {
+                       String context = makeLocationContext(unit, problem);
+                       // XXX 0 column is wrong but recoverable from makeLocationContext
+                       return new SourceLocation(file, line, line, 0, context);
+               }
        }
 
        /**
         * Extract message text and source location, including context.
         * 
         * @param world
+        * @param progressListener 
         */
-       public static IMessage makeMessage(ICompilationUnit unit, IProblem problem, World world) {
-               ISourceLocation sourceLocation = makeSourceLocation(unit, problem);
+       public static IMessage makeMessage(ICompilationUnit unit, IProblem problem, World world, IProgressListener progressListener) {
+               ISourceLocation sourceLocation = makeSourceLocation(unit, problem, progressListener);
                IProblem[] seeAlso = problem.seeAlso();
                // If the user has turned off classfile line number gen, then we may not be able to tell them
                // about all secondary locations (pr209372)