tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1803636 - in /tomcat/trunk: java/org/apache/jasper/compiler/ParserController.java webapps/docs/changelog.xml
Date Tue, 01 Aug 2017 12:08:08 GMT
Author: markt
Date: Tue Aug  1 12:08:08 2017
New Revision: 1803636

URL: http://svn.apache.org/viewvc?rev=1803636&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=61364
Close InputStream to prevent locked files.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java?rev=1803636&r1=1803635&r2=1803636&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java Tue Aug  1 12:08:08
2017
@@ -318,8 +318,10 @@ class ParserController implements TagCon
             sourceEnc = "ISO-8859-1";
         } else {
             // XML syntax or unknown, (auto)detect encoding ...
-            BufferedInputStream bis = JspUtil.getInputStream(absFileName, jar, ctxt);
-            EncodingDetector encodingDetector = new EncodingDetector(bis);
+            EncodingDetector encodingDetector;
+            try (BufferedInputStream bis = JspUtil.getInputStream(absFileName, jar, ctxt))
{
+                encodingDetector = new EncodingDetector(bis);
+            }
 
             sourceEnc = encodingDetector.getEncoding();
             isEncodingSpecifiedInProlog = encodingDetector.isEncodingSpecifiedInProlog();

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1803636&r1=1803635&r2=1803636&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Aug  1 12:08:08 2017
@@ -86,6 +86,14 @@
       </add>
     </changelog>
   </subsection>
+  <subsection name="Jasper">
+    <changelog>
+      <fix>
+        <bug>61364</bug>: Ensure that files are closed after detecting encoding
+        of JSPs so that files do not remain locked by the file system. (markt)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 9.0.0.M25 (markt)" rtext="2017-07-28">
   <subsection name="Catalina">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message