Changeset acebd2e for core


Ignore:
Timestamp:
Feb 17, 2018 7:53:30 PM (2 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
826d8ca
Parents:
fb6eea2
Message:

Cleanups: Close resources via try-finally

Location:
core/java/src/net/i2p
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/naming/SingleFileNamingService.java

    rfb6eea2 racebd2e  
    262262            _log.error("Error adding " + hostname, ioe);
    263263            return false;
    264         } finally { releaseWriteLock(); }
     264        } finally {
     265            if (out != null) try { out.close(); } catch (IOException e) {}
     266            releaseWriteLock();
     267        }
    265268    }
    266269
  • core/java/src/net/i2p/util/TranslateReader.java

    rfb6eea2 racebd2e  
    395395
    396396    private static void test(String file) throws IOException {
    397         FileInputStream fio = new FileInputStream(file);
    398397        TranslateReader r = null;
    399398        try {
    400399            r = new TranslateReader(I2PAppContext.getGlobalContext(),
    401400                                    "net.i2p.router.web.messages",
    402                                     fio);
     401                                    new FileInputStream(file));
    403402            int c;
    404403            while ((c = r.read()) >= 0) {
Note: See TracChangeset for help on using the changeset viewer.