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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r6248 r6268  
    3333import org.openstreetmap.josm.io.MirroredInputStream;
    3434import org.openstreetmap.josm.tools.Pair;
     35import org.openstreetmap.josm.tools.Utils;
    3536
    3637/**
     
    125126    private static void loadInits() {
    126127        Pattern epsgPattern = Pattern.compile("<(\\d+)>(.*)<>");
     128        BufferedReader r = null;
    127129        try {
    128130            InputStream in = new MirroredInputStream("resource://data/epsg");
    129             BufferedReader r = new BufferedReader(new InputStreamReader(in));
     131            r = new BufferedReader(new InputStreamReader(in));
    130132            String line, lastline = "";
    131133            while ((line = r.readLine()) != null) {
     
    144146            }
    145147        } catch (IOException ex) {
    146             throw new RuntimeException();
     148            throw new RuntimeException(ex);
     149        } finally {
     150            Utils.close(r);
    147151        }
    148152    }
Note: See TracChangeset for help on using the changeset viewer.