We were failing to close the newly-opened FileInputStream, and thankfully StandardGeneratorContextTest caught it. BUILD FIX: r6511 Review by: spoon (TBR) git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6535 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java index e10e51a..ea92ae0 100644 --- a/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java +++ b/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java
@@ -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); } }