mirror of https://github.com/apache/openjpa.git
OPENJPA-518 Committing code changes suggested by Adam Toback
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@629490 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f99bdbce5f
commit
bb3eb94ce2
|
@ -23,6 +23,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -111,11 +112,16 @@ public class Services {
|
||||||
* ignored.
|
* ignored.
|
||||||
*/
|
*/
|
||||||
private static void addResources(URL url, Set set) throws IOException {
|
private static void addResources(URL url, Set set) throws IOException {
|
||||||
InputStream in = url.openConnection().getInputStream();
|
InputStream in = null;
|
||||||
|
BufferedReader reader = null;
|
||||||
|
URLConnection urlCon = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
urlCon = url.openConnection();
|
||||||
in));
|
urlCon.setUseCaches(false);
|
||||||
|
in = urlCon.getInputStream();
|
||||||
|
reader = new BufferedReader(new InputStreamReader(in));
|
||||||
|
|
||||||
String line;
|
String line;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
if (line.trim().startsWith("#")
|
if (line.trim().startsWith("#")
|
||||||
|
@ -133,6 +139,11 @@ public class Services {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
try {
|
||||||
|
reader.close();
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
// silently consume exception
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
in.close();
|
in.close();
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
|
|
Loading…
Reference in New Issue