Ignore:
Timestamp:
2013-04-16T19:57:43+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8570, #7406 - I/O refactorization:

  • Move different file copy functions to Utils.copyFile (to be replaced later by Files.copy when switching to Java 7)
  • Replace all Utils.close(XXX) by Utils.close(Closeable) -> impacted plugins: commandline, mirrored_download, opendata, piclayer
  • Add new Utils.close(ZipFile)
  • Use of Utils.close almost everywhere
  • Javadoc fixes
Location:
trunk/src/org/openstreetmap/josm/gui/help
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r5816 r5874  
    5151import org.openstreetmap.josm.tools.ImageProvider;
    5252import org.openstreetmap.josm.tools.OpenBrowser;
     53import org.openstreetmap.josm.tools.Utils;
    5354import org.openstreetmap.josm.tools.WindowGeometry;
    5455
     
    141142                css.append("\n");
    142143            }
    143             reader.close();
    144144        } catch(Exception e) {
    145145            System.err.println(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString()));
    146146            e.printStackTrace();
    147147            return ss;
     148        } finally {
     149            Utils.close(reader);
    148150        }
    149151        ss.addRule(css.toString());
  • trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java

    r5868 r5874  
    6262            throw ex;
    6363        } finally {
    64             if (in != null) {
    65                 try {
    66                     in.close();
    67                 } catch(IOException e) {
    68                     // ignore
    69                 }
    70             }
     64            Utils.close(in);
    7165        }
    7266    }
Note: See TracChangeset for help on using the changeset viewer.