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.
public void beforeCompiling(ICompilationUnit[] sourceUnits) {
resultsPendingWeave = new ArrayList();
reportedErrors = false;
+ droppingBackToFullBuild=false;
}
// acceptResult(unit.compilationResult);
// } else {
try {
- weaveQueuedEntries();
+ if (weaveQueuedEntries()) droppingBackToFullBuild=true;
} catch (IOException ex) {
AbortCompilation ac = new AbortCompilation(null,ex);
throw ac;
}
if (pipelineStalled) return;
try {
- weaveQueuedEntries();
+ if (weaveQueuedEntries()) droppingBackToFullBuild=true;
} catch (IOException ex) {
AbortCompilation ac = new AbortCompilation(null,ex);
throw ac;
}
}
- 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();
}
}
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() {
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);
configureBuildStructureModel(false);
}
+ public void testAdviceDidNotMatch_pr152589() {
+ initialiseProject("PR152589");
+ build("PR152589");
+ List warnings = MyTaskListManager.getWarningMessages();
+ assertTrue("There should be no warnings:\n"+warnings,
+ warnings.isEmpty());
+ alter("PR152589","inc1");
+ build("PR152589");
+ checkWasFullBuild();
+ warnings = MyTaskListManager.getWarningMessages();
+ assertTrue("There should be no warnings after adding a whitespace:\n"
+ +warnings,warnings.isEmpty());
+ }
+
// --- helper code ---
/**