Revision: 6535
Author: [email protected]
Date: Wed Oct 28 17:30:02 2009
Log: We were failing to close the newly-opened FileInputStream, and  
thankfully StandardGeneratorContextTest caught it.

BUILD FIX: r6511
Review by: spoon (TBR)

http://code.google.com/p/google-web-toolkit/source/detail?r=6535

Modified:
   
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java

=======================================
---  
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
   
Wed Oct 28 09:26:56 2009
+++  
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
   
Wed Oct 28 17:30:02 2009
@@ -20,6 +20,7 @@
  import com.google.gwt.core.ext.UnableToCompleteException;
  import com.google.gwt.core.ext.linker.GeneratedResource;
  import com.google.gwt.dev.util.DiskCache;
+import com.google.gwt.util.tools.Utility;

  import java.io.ByteArrayInputStream;
  import java.io.File;
@@ -45,11 +46,15 @@
        String partialPath, File file) {
      super(StandardLinkerContext.class, generatorType, partialPath);
      this.lastModified = file.lastModified();
+    FileInputStream fis = null;
      try {
-      this.token = diskCache.transferFromStream(new FileInputStream(file));
+      fis = new FileInputStream(file);
+      this.token = diskCache.transferFromStream(fis);
      } catch (FileNotFoundException e) {
        throw new RuntimeException("Unable to open file '"
            + file.getAbsolutePath() + "'", e);
+    } finally {
+      Utility.close(fis);
      }
    }


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

Reply via email to