mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8280010: Remove double buffering of InputStream for Properties.load
Reviewed-by: amenkov, sspitsyn, serb
This commit is contained in:
parent
64c0c0e109
commit
9eb50a5ee4
8 changed files with 19 additions and 30 deletions
|
@ -68,9 +68,8 @@ public class NetProperties {
|
|||
File f = new File(fname, "conf");
|
||||
f = new File(f, "net.properties");
|
||||
fname = f.getCanonicalPath();
|
||||
try (FileInputStream in = new FileInputStream(fname);
|
||||
BufferedInputStream bin = new BufferedInputStream(in)) {
|
||||
props.load(bin);
|
||||
try (FileInputStream in = new FileInputStream(fname)) {
|
||||
props.load(in);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Do nothing. We couldn't find or access the file
|
||||
|
|
|
@ -244,8 +244,8 @@ public class MimeTable implements FileNameMap {
|
|||
throw new InternalError("default mime table not found");
|
||||
}
|
||||
|
||||
try (BufferedInputStream bin = new BufferedInputStream(in)) {
|
||||
entries.load(bin);
|
||||
try (in) {
|
||||
entries.load(in);
|
||||
} catch (IOException e) {
|
||||
System.err.println("Warning: " + e.getMessage());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue