aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2005-04-29 14:03:55 +0000
committeraclement <aclement>2005-04-29 14:03:55 +0000
commit28a5bce27afc1b25460d6fe3273ae2e0272dd53e (patch)
tree27d13439262e953c4dfe34fcb27c9a84ccaafe7d /org.aspectj.ajdt.core
parent73f725313c7e12c8c57ed357dbc3ab8cc9abe18f (diff)
downloadaspectj-28a5bce27afc1b25460d6fe3273ae2e0272dd53e.tar.gz
aspectj-28a5bce27afc1b25460d6fe3273ae2e0272dd53e.zip
More bullet proof and with added diagnostics.
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
index 8251f5c9f..4a657b5ed 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
@@ -32,6 +32,7 @@ public class IncrementalStateManager {
// FIXME asc needs some memory mgmt (softrefs?) to recover memory
// SECRETAPI will consume more memory, so turn on at your own risk ;) Set to 'true' when memory usage is understood
public static boolean recordIncrementalStates = false;
+ public static boolean debugIncrementalStates = false;
private static Hashtable incrementalStates = new Hashtable();
public static void recordSuccessfulBuild(String buildConfig, AjState state) {
@@ -59,11 +60,27 @@ public class IncrementalStateManager {
public static AjState findStateManagingOutputLocation(File location) {
Collection allStates = incrementalStates.values();
+ if (debugIncrementalStates) System.err.println("> findStateManagingOutputLocation("+location+") has "+allStates.size()+" states to look through");
for (Iterator iter = allStates.iterator(); iter.hasNext();) {
AjState element = (AjState) iter.next();
- File outputDir = element.buildConfig.getOutputDir();
- if (outputDir.equals(location)) return element;
+ AjBuildConfig ajbc = element.buildConfig;
+ if (ajbc==null) {
+ // FIXME asc why can it ever be null?
+ if (debugIncrementalStates) System.err.println(" No build configuration for state "+element);
+ continue;
+ }
+ File outputDir = ajbc.getOutputDir();
+ if (outputDir == null) {
+ // FIXME why can it ever be null? due to using outjar?
+ if (debugIncrementalStates) System.err.println(" output directory for "+ajbc+" is null");
+ continue;
+ }
+ if (outputDir.equals(location)) {
+ if (debugIncrementalStates) System.err.println("< findStateManagingOutputLocation("+location+") returning "+element);
+ return element;
+ }
}
+ if (debugIncrementalStates) System.err.println("< findStateManagingOutputLocation("+location+") returning null");
return null;
}