diff options
author | aclement <aclement> | 2006-08-03 07:23:55 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-08-03 07:23:55 +0000 |
commit | 9664058bcdaeb4934a01969f4e5f651bc6e8cd71 (patch) | |
tree | b74e2bb75ccce05f56f7725d7119472515a5c332 /org.aspectj.ajdt.core | |
parent | 9b96943ffeac0c120464cc268a0cd98b7667869c (diff) | |
download | aspectj-9664058bcdaeb4934a01969f4e5f651bc6e8cd71.tar.gz aspectj-9664058bcdaeb4934a01969f4e5f651bc6e8cd71.zip |
test and fix for 152589: adviceDidNotMatch incorrectly appearing
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java index dbc0a12a2..d2cf77b3b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java @@ -145,7 +145,9 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { private boolean pipelineStalled = true; private boolean weaverInitialized = false; private int toWaitFor; - + // If we determine we are going to drop back to a full build - don't need to tell the weaver to report adviceDidNotMatch + private boolean droppingBackToFullBuild; + /** * Create an adapter, and tell it everything it needs to now to drive the AspectJ * parts of a compile cycle. @@ -270,6 +272,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { public void beforeCompiling(ICompilationUnit[] sourceUnits) { resultsPendingWeave = new ArrayList(); reportedErrors = false; + droppingBackToFullBuild=false; } @@ -323,7 +326,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { // acceptResult(unit.compilationResult); // } else { try { - weaveQueuedEntries(); + if (weaveQueuedEntries()) droppingBackToFullBuild=true; } catch (IOException ex) { AbortCompilation ac = new AbortCompilation(null,ex); throw ac; @@ -386,7 +389,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { } if (pipelineStalled) return; try { - weaveQueuedEntries(); + if (weaveQueuedEntries()) droppingBackToFullBuild=true; } catch (IOException ex) { AbortCompilation ac = new AbortCompilation(null,ex); throw ac; @@ -438,7 +441,8 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { } } - private void weaveQueuedEntries() throws IOException { + /** Return true if we've decided to drop back to a full build (too much has changed) */ + private boolean weaveQueuedEntries() throws IOException { if (debugPipeline)System.err.println(">.weaveQueuedEntries()"); for (Iterator iter = resultsPendingWeave.iterator(); iter.hasNext();) { InterimCompilationResult iresult = (InterimCompilationResult) iter.next(); @@ -447,11 +451,12 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { } } ensureWeaverInitialized(); // by doing this only once, are we saying needToReweaveWorld can't change once the aspects have been stuffed into the weaver? - if (weaver.needToReweaveWorld() && !isBatchCompile) return; + if (weaver.needToReweaveWorld() && !isBatchCompile) return true; weaver.weave(new WeaverAdapter(this,weaverMessageHandler,progressListener)); resultsPendingWeave.clear(); // dont need to do those again this.eWorld.minicleanup(); if (debugPipeline)System.err.println("<.weaveQueuedEntries()"); + return false; } private void ensureWeaverInitialized() { @@ -514,7 +519,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { CflowPointcut.clearCaches(); if (imh instanceof WeaverMessageHandler) ((WeaverMessageHandler)imh).setCurrentResult(null); - weaver.allWeavingComplete(); + if (!droppingBackToFullBuild) weaver.allWeavingComplete(); weaver.tidyUp(); if (imh instanceof WeaverMessageHandler) ((WeaverMessageHandler)imh).resetCompiler(null); |