Author: [email protected]
Date: Wed Jul 15 08:39:35 2009
New Revision: 5738

Modified:
     
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/BinaryCompiledClass.java
     
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/CompilationState.java
     
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/impl/SourceFileCompilationUnit.java

Log:
More cleanups.


Modified:  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/BinaryCompiledClass.java
==============================================================================
---  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/BinaryCompiledClass.java  
 
(original)
+++  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/BinaryCompiledClass.java  
 
Wed Jul 15 08:39:35 2009
@@ -43,8 +43,6 @@

    private String name;

-  private List<Resource> innerClasses;
-
    private Resource classResource;

    private byte[] bytes;
@@ -52,14 +50,12 @@
    private String source;

    public BinaryCompiledClass(Resource classResource, byte[] bytes,
-      CompiledClass enclosingClass, String name, List<Resource>  
innerClasses,
-      String source) {
+      CompiledClass enclosingClass, String name, String source) {
      super(null, enclosingClass);
      this.classResource = classResource;
      this.bytes = bytes;
      assert Name.isInternalName(name);
      this.name = name;
-    this.innerClasses = innerClasses;
      this.source = source;
    }

@@ -72,13 +68,6 @@
      return bytes;
    }

-  /**
-   * @return the innerClasses
-   */
-  public List<Resource> getInnerClasses() {
-    return innerClasses;
-  }
-
    @Override
    public String getInternalName() {
      return name;
@@ -119,7 +108,7 @@

    @Override
    void checked() {
-    // TODO(jat): implement
+    // TODO(jat): anything we can/should free up?
    }

    Resource getClassResource() {

Modified:  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/CompilationState.java
==============================================================================
---  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/CompilationState.java     
 
(original)
+++  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/CompilationState.java     
 
Wed Jul 15 08:39:35 2009
@@ -91,7 +91,7 @@
    /**
     * Unmodifiable view of all units.
     */
-  private Collection<CompilationUnit> exposedUnits =  
Collections.unmodifiableCollection(unitMap.values());
+  private final Collection<CompilationUnit> exposedUnits =  
Collections.unmodifiableCollection(unitMap.values());

    private CompilationUnitInvalidator.InvalidatorState invalidatorState =  
new CompilationUnitInvalidator.InvalidatorState();

@@ -434,20 +434,6 @@
    private void refreshFromOracles(TreeLogger logger) {
      long startTimestamp = System.currentTimeMillis();

-    // See if the source oracle has changed.
-    // TODO(jat): do we need to consider binaries here?
-    Set<Resource> newSourceFiles = sourceOracle.getResources();
-    if (cachedSourceFiles == newSourceFiles) {
-      return;
-    }
-
-    // Divide sources into changed and unchanged.
-    Set<Resource> unchangedSrc = new HashSet<Resource>(
-        cachedSourceFiles);
-    unchangedSrc.retainAll(newSourceFiles);
-    Set<Resource> changedSrc = new HashSet<Resource>(newSourceFiles);
-    changedSrc.removeAll(unchangedSrc);
-
      // Invalidate binaries depending on changed sources, get new binaries
      Set<JavaBinary> newBinaries;
      Map<String, JavaBinary> newBinaryMap;
@@ -460,6 +446,19 @@
        newBinaries = Collections.emptySet();
        newBinaryMap = Collections.emptyMap();
      }
+    // See if the oracles have changed.
+    Set<Resource> newSourceFiles = sourceOracle.getResources();
+    if (cachedSourceFiles == newSourceFiles && cachedBinaries ==  
newBinaries) {
+      return;
+    }
+
+    // Divide sources into changed and unchanged.
+    Set<Resource> unchangedSrc = new HashSet<Resource>(
+        cachedSourceFiles);
+    unchangedSrc.retainAll(newSourceFiles);
+    Set<Resource> changedSrc = new HashSet<Resource>(newSourceFiles);
+    changedSrc.removeAll(unchangedSrc);
+

      // Divide binaries into changed and unchanged.
      Set<JavaBinary> unchangedBin = new HashSet<JavaBinary>(
@@ -540,12 +539,5 @@
          it.remove();
        }
      }
-  }
-
-  private void updateExposedUnits() {
-    exposedUnits = Collections.unmodifiableSet(new  
HashSet<CompilationUnit>(
-        unitMap.values()));
-    exposedClassFileMap = null;
-    exposedClassFileMapBySource = null;
    }
  }

Modified:  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/impl/SourceFileCompilationUnit.java
==============================================================================
---  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/impl/SourceFileCompilationUnit.java
        
(original)
+++  
changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/impl/SourceFileCompilationUnit.java
        
Wed Jul 15 08:39:35 2009
@@ -77,9 +77,8 @@
      }

      public BinaryCompiledClass getBinaryCompiledClass() {
-      // TODO(jat): !! fix null
        return new BinaryCompiledClass(classResource, bytes, enclosingClass,
-          name, null, source);
+          name, source);
      }

      /**

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to