src/share/classes/sun/applet/Main.java

Print this page

        

*** 430,443 **** dotHJ.toString())); avProps = setDefaultAVProps(); } // SAVE THE FILE ! 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())); } } --- 430,441 ---- dotHJ.toString())); avProps = setDefaultAVProps(); } // SAVE THE FILE ! try (FileOutputStream out = new FileOutputStream(dotAV)) { avProps.store(out, lookup("main.prop.store")); } catch (IOException e) { System.err.println(lookup("main.err.prop.cantsave", dotAV.toString())); } }
*** 470,486 **** private Properties getAVProps(File inFile) { Properties avProps = new Properties(); // read the file Properties tmpProps = new Properties(); ! 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())); } // pick off the properties we care about for (int i = 0; i < avDefaultUserProps.length; i++) { String value = tmpProps.getProperty(avDefaultUserProps[i][0]); --- 468,481 ---- private Properties getAVProps(File inFile) { Properties avProps = new Properties(); // read the file Properties tmpProps = new Properties(); ! try (FileInputStream in = new FileInputStream(inFile)) { tmpProps.load(new BufferedInputStream(in)); } catch (IOException e) { ! System.err.println(lookup("main.err.prop.cantread", inFile.toString())); } // pick off the properties we care about for (int i = 0; i < avDefaultUserProps.length; i++) { String value = tmpProps.getProperty(avDefaultUserProps[i][0]);