[LOGGING-163] BufferedReader is not closed properly.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/logging/trunk@1765341 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -44,6 +44,9 @@ The <action> type attribute can be add,update,fix,remove.
|
|||||||
</properties>
|
</properties>
|
||||||
<body>
|
<body>
|
||||||
<release version="1.2.1" date="TBD" description="This is a maintenance release containing bug fixes. Java 1.2 or later is required.">
|
<release version="1.2.1" date="TBD" description="This is a maintenance release containing bug fixes. Java 1.2 or later is required.">
|
||||||
|
<action issue="LOGGING-163" dev="ggregory" type="fix" due-to="Kaloyan Spiridonov">
|
||||||
|
BufferedReader is not closed properly.
|
||||||
|
</action>
|
||||||
</release>
|
</release>
|
||||||
<release version="1.2" date="2014-07-11" description="This is a maintenance release containing bug fixes. Java 1.2 or later is required.">
|
<release version="1.2" date="2014-07-11" description="This is a maintenance release containing bug fixes. Java 1.2 or later is required.">
|
||||||
<action issue="LOGGING-37" dev="tn" type="fix" due-to="Matthias Ernst,Archie Cobbs">
|
<action issue="LOGGING-37" dev="tn" type="fix" due-to="Matthias Ernst,Archie Cobbs">
|
||||||
|
|||||||
@@ -539,8 +539,12 @@ public abstract class LogFactory {
|
|||||||
rd = new BufferedReader(new InputStreamReader(is));
|
rd = new BufferedReader(new InputStreamReader(is));
|
||||||
}
|
}
|
||||||
|
|
||||||
String factoryClassName = rd.readLine();
|
String factoryClassName;
|
||||||
|
try {
|
||||||
|
factoryClassName = rd.readLine();
|
||||||
|
} finally {
|
||||||
rd.close();
|
rd.close();
|
||||||
|
}
|
||||||
|
|
||||||
if (factoryClassName != null && ! "".equals(factoryClassName)) {
|
if (factoryClassName != null && ! "".equals(factoryClassName)) {
|
||||||
if (isDiagnosticsEnabled()) {
|
if (isDiagnosticsEnabled()) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.apache.commons.logging.impl;
|
package org.apache.commons.logging.impl;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -161,9 +162,14 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
if (null != in) {
|
if (null != in) {
|
||||||
try {
|
try {
|
||||||
simpleLogProps.load(in);
|
simpleLogProps.load(in);
|
||||||
in.close();
|
|
||||||
} catch (java.io.IOException e) {
|
} catch (java.io.IOException e) {
|
||||||
// ignored
|
// ignored
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
in.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user