Author: remy.maucherat(a)jboss.com
Date: 2010-12-08 11:15:22 -0500 (Wed, 08 Dec 2010)
New Revision: 1609
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/jasper/compiler/JDTCompiler.java
trunk/webapps/docs/changelog.xml
Log:
- Port patch to close a reader in JDT, as well as an IS when using a JMX call.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2010-12-07 22:40:05 UTC (rev
1608)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2010-12-08 16:15:22 UTC (rev
1609)
@@ -4541,17 +4541,25 @@
if (stream == null) {
return "";
}
- BufferedReader br = new BufferedReader(
- new InputStreamReader(stream));
+ BufferedReader br = null;
StringBuilder sb = new StringBuilder();
- String strRead = "";
try {
+ br = new BufferedReader(new InputStreamReader(stream));
+ String strRead = "";
while (strRead != null) {
sb.append(strRead);
strRead = br.readLine();
}
} catch (IOException e) {
return "";
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
}
return sb.toString();
Modified: trunk/java/org/apache/jasper/compiler/JDTCompiler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JDTCompiler.java 2010-12-07 22:40:05 UTC (rev
1608)
+++ trunk/java/org/apache/jasper/compiler/JDTCompiler.java 2010-12-08 16:15:22 UTC (rev
1609)
@@ -100,10 +100,10 @@
public char[] getContents() {
char[] result = null;
FileInputStream is = null;
+ Reader reader = null;
try {
is = new FileInputStream(sourceFile);
- Reader reader =
- new BufferedReader(new InputStreamReader(is,
ctxt.getOptions().getJavaEncoding()));
+ reader = new BufferedReader(new InputStreamReader(is,
ctxt.getOptions().getJavaEncoding()));
if (reader != null) {
char[] chars = new char[8192];
StringBuilder buf = new StringBuilder();
@@ -118,6 +118,13 @@
} catch (IOException e) {
log.error("Compilation error", e);
} finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException exc) {
+ // Ignore
+ }
+ }
if (is != null) {
try {
is.close();
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-12-07 22:40:05 UTC (rev 1608)
+++ trunk/webapps/docs/changelog.xml 2010-12-08 16:15:22 UTC (rev 1609)
@@ -16,6 +16,25 @@
<body>
+<section name="JBoss Web 3.0.0.Beta9 (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <bug>49991</bug>: Fix calling Request listeners when entering and
exiting
+ the application scope in the main host valve, not simply just before
+ calling the filter chain. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ Close reader in JDT compiler. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 3.0.0.Beta8 (remm)">
<subsection name="Catalina">
<changelog>
@@ -32,10 +51,6 @@
<bug>49779</bug>: Interaction between continue and FORM. (markt)
</fix>
<fix>
- <bug>49991</bug>: Actually call Request listener when entering and
exiting the application scope, not simply just before
- calling the filter chain. (remm)
- </fix>
- <fix>
Allow a landing page for FORM. (markt)
</fix>
<fix>
Show replies by date