提交 1c698565 编写于 作者: K kohsuke

fixed a stream leak

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11275 71c3de6d-444a-0410-be80-ed276b4c234a
上级 81bf68c5
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册