This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch release_practice
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit fdc8e7a1ec3bfb8fa32c70a0fd49a7ae4ec300e1
Author: Alex Harui <[email protected]>
AuthorDate: Mon Jun 3 21:05:51 2019 -0700

    refactor so we don't create unused InputStreams
---
 .../apache/royale/compiler/filespecs/FileSpecification.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/compiler-common/src/main/java/org/apache/royale/compiler/filespecs/FileSpecification.java
 
b/compiler-common/src/main/java/org/apache/royale/compiler/filespecs/FileSpecification.java
index b77a2ff..db368ed 100644
--- 
a/compiler-common/src/main/java/org/apache/royale/compiler/filespecs/FileSpecification.java
+++ 
b/compiler-common/src/main/java/org/apache/royale/compiler/filespecs/FileSpecification.java
@@ -120,11 +120,11 @@ public class FileSpecification extends 
BaseFileSpecification implements IBinaryF
            final BOM bom = getBOM(strm);
         strm.skip(bom.pattern.length);
         
-        final NoCRLFInputStream input = new NoCRLFInputStream(strm);
-
-        final Reader reader = new BufferedReader(
-                new InputStreamReader(useCRLFFilter ? input : strm, 
bom.charset));
-        input.close();
+        final InputStreamReader inputSR = useCRLFFilter ? 
+                       new InputStreamReader(new NoCRLFInputStream(strm), 
bom.charset) :
+                new InputStreamReader(strm, bom.charset);
+                               
+        final Reader reader = new BufferedReader(inputSR);
         return reader;
        }
 

Reply via email to