Ignore:
Timestamp:
2013-09-27T19:50:29+02:00 (11 years ago)
Author:
Don-vip
Message:

Sonar/FindBugs - Bad practice - Method may fail to close stream

Location:
trunk/test/functional/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r5556 r6268  
    1212import java.io.FileWriter;
    1313import java.io.IOException;
     14import java.io.InputStream;
    1415import java.io.PrintWriter;
    1516import java.text.MessageFormat;
     
    138139        //
    139140        try {
    140             testProperties.load(MultiFetchServerObjectReaderTest.class.getResourceAsStream("/test-functional-env.properties"));
     141            InputStream is = MultiFetchServerObjectReaderTest.class.getResourceAsStream("/test-functional-env.properties");
     142            testProperties.load(is);
     143            is.close();
    141144        } catch(Exception e){
    142145            logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", "test-functional-env.properties"));
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r5556 r6268  
    1010import java.io.FileWriter;
    1111import java.io.IOException;
     12import java.io.InputStream;
    1213import java.io.PrintWriter;
    1314import java.text.MessageFormat;
     
    145146        //
    146147        try {
    147             testProperties.load(MultiFetchServerObjectReaderTest.class.getResourceAsStream("/test-functional-env.properties"));
     148            InputStream is = MultiFetchServerObjectReaderTest.class.getResourceAsStream("/test-functional-env.properties");
     149            testProperties.load(is);
     150            is.close();
    148151        } catch(Exception e){
    149152            logger.log(Level.SEVERE, MessageFormat.format("failed to load property file ''{0}''", "test-functional-env.properties"));
Note: See TracChangeset for help on using the changeset viewer.