--- a/jdk/src/share/classes/sun/applet/Main.java Fri Nov 15 17:40:34 2013 +0400
+++ b/jdk/src/share/classes/sun/applet/Main.java Mon Nov 18 19:22:29 2013 +0400
@@ -432,10 +432,8 @@
}
// SAVE THE FILE
- try {
- FileOutputStream out = new FileOutputStream(dotAV);
+ try (FileOutputStream out = new FileOutputStream(dotAV)) {
avProps.store(out, lookup("main.prop.store"));
- out.close();
} catch (IOException e) {
System.err.println(lookup("main.err.prop.cantsave",
dotAV.toString()));
@@ -472,13 +470,10 @@
// read the file
Properties tmpProps = new Properties();
- try {
- FileInputStream in = new FileInputStream(inFile);
+ try (FileInputStream in = new FileInputStream(inFile)) {
tmpProps.load(new BufferedInputStream(in));
- in.close();
} catch (IOException e) {
- System.err.println(lookup("main.err.prop.cantread",
- inFile.toString()));
+ System.err.println(lookup("main.err.prop.cantread", inFile.toString()));
}
// pick off the properties we care about