]> source.dussan.org Git - aspectj.git/commitdiff
328649: addDependencies for Compilation Participants
authoraclement <aclement>
Tue, 26 Oct 2010 19:25:25 +0000 (19:25 +0000)
committeraclement <aclement>
Tue, 26 Oct 2010 19:25:25 +0000 (19:25 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java

index 6bad99f3b444d2e8d32c41c8230603e9d4a5b95c..dc9b4f4af4aafb39af7c6abba737b36996fcd4f8 100644 (file)
@@ -1920,14 +1920,23 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
         * need to recompile the file named in the CompilationResult. This method patches that information into the existing data
         * structures.
         */
-       public void recordDependencies(CompilationResult result, String[] typeNameDependencies) {
-               File sourceFile = new File(new String(result.fileName));
-               ReferenceCollection existingCollection = references.get(sourceFile);
-               if (existingCollection != null) {
-                       existingCollection.addDependencies(typeNameDependencies);
-               } else {
-                       references.put(sourceFile, new ReferenceCollection(result.qualifiedReferences, result.simpleNameReferences));
+       public boolean recordDependencies(File file, String[] typeNameDependencies) {
+               try {
+                       File sourceFile = new File(new String(file.getCanonicalPath()));
+                       ReferenceCollection existingCollection = references.get(sourceFile);
+                       if (existingCollection != null) {
+                               existingCollection.addDependencies(typeNameDependencies);
+                               return true;
+                       } else {
+                               ReferenceCollection rc = new ReferenceCollection(null, null);
+                               rc.addDependencies(typeNameDependencies);
+                               references.put(sourceFile, rc);
+                               return true;
+                       }
+               } catch (IOException ioe) {
+                       ioe.printStackTrace();
                }
+               return false;
        }
 
        protected void addDependentsOf(File sourceFile) {