aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-03-16 15:07:19 +0000
committeracolyer <acolyer>2004-03-16 15:07:19 +0000
commit41c6f6d0a10e881ac705a108cdd59f31d160e1c7 (patch)
tree221d7d447adfd749b8fd4a3fec6710d94e31c75d
parente7e39213279572e5315f5a24883f8a16c84f9c8b (diff)
downloadaspectj-41c6f6d0a10e881ac705a108cdd59f31d160e1c7.tar.gz
aspectj-41c6f6d0a10e881ac705a108cdd59f31d160e1c7.zip
fix for Bugzilla Bug 54965
Incremental compilation does twice as much work as necessary
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
index 206bcec1a..d1b32e780 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
@@ -49,6 +49,7 @@ public class AjState {
Map/*<File, ReferenceCollection>*/ references = new HashMap();
Map/*File, List<UnwovenClassFile>*/ binarySourceFiles = new HashMap();
Map/*<String, UnwovenClassFile>*/ classesFromName = new HashMap();
+ List/*File*/ compiledSourceFiles = new ArrayList();
ArrayList/*<String>*/ qualifiedStrings;
ArrayList/*<String>*/ simpleStrings;
@@ -79,6 +80,8 @@ public class AjState {
return false;
}
+// if (newBuildConfig.getOutputJar() != null) return false;
+
simpleStrings = new ArrayList();
qualifiedStrings = new ArrayList();
@@ -117,27 +120,29 @@ public class AjState {
public List getFilesToCompile(boolean firstPass) {
- List sourceFiles = new ArrayList();
+ List thisTime = new ArrayList();
if (firstPass) {
+ compiledSourceFiles = new ArrayList();
Collection modifiedFiles = getModifiedFiles();
//System.out.println("modified: " + modifiedFiles);
- sourceFiles.addAll(modifiedFiles);
+ thisTime.addAll(modifiedFiles);
//??? eclipse IncrementalImageBuilder appears to do this
// for (Iterator i = modifiedFiles.iterator(); i.hasNext();) {
// File file = (File) i.next();
// addDependentsOf(file);
// }
- sourceFiles.addAll(addedFiles);
+ thisTime.addAll(addedFiles);
deleteClassFiles();
- addAffectedSourceFiles(sourceFiles);
+ addAffectedSourceFiles(thisTime,thisTime);
} else {
- addAffectedSourceFiles(sourceFiles);
+ addAffectedSourceFiles(thisTime,compiledSourceFiles);
}
- return sourceFiles;
+ compiledSourceFiles = thisTime;
+ return thisTime;
}
private void deleteClassFiles() {
@@ -321,7 +326,7 @@ public class AjState {
- protected void addAffectedSourceFiles(List sourceFiles) {
+ protected void addAffectedSourceFiles(List addTo, List lastTimeSources) {
if (qualifiedStrings.isEmpty() && simpleStrings.isEmpty()) return;
// the qualifiedStrings are of the form 'p1/p2' & the simpleStrings are just 'X'
@@ -343,8 +348,8 @@ public class AjState {
if (refs != null && refs.includes(qualifiedNames, simpleNames)) {
File file = (File)entry.getKey();
if (file.exists()) {
- if (!sourceFiles.contains(file)) { //??? O(n**2)
- sourceFiles.add(file);
+ if (!lastTimeSources.contains(file)) { //??? O(n**2)
+ addTo.add(file);
}
}
}