fixed a stream leak

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11275 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-08-06 17:04:15 +00:00
1 parent 81bf68c5ed
commit 1c698565fa
1 file changed
+11 -6
+11 -6
View File
@@ -147,12 +147,17 @@ public final class PluginWrapper {
if(isLinked) {
// resolve the .hpl file to the location of the manifest file
String firstLine = new BufferedReader(new FileReader(archive)).readLine();
if(firstLine.startsWith("Manifest-Version:")) {
// this is the manifest already
} else {
// indirection
archive = resolve(archive, firstLine);
BufferedReader archiveReader = new BufferedReader(new FileReader(archive));
try {
String firstLine = archiveReader.readLine();
if(firstLine.startsWith("Manifest-Version:")) {
// this is the manifest already
} else {
// indirection
archive = resolve(archive, firstLine);
}
} finally {
archiveReader.close();
}
// then parse manifest
FileInputStream in = new FileInputStream(archive);