mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
ignore redundant calls to File{In|Out}putStream.close
Previously, we threw an IOException, which did not match Sun's behavior.
This commit is contained in:
@ -55,7 +55,9 @@ public class FileInputStream extends InputStream {
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,9 @@ public class FileOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user