Ignore:
Timestamp:
2014-05-01T02:34:43+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8465 - global use of try-with-resources, according to

Location:
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java

    r7005 r7033  
    33
    44import java.io.FileInputStream;
    5 import java.io.FileNotFoundException;
     5import java.io.IOException;
     6import java.io.InputStream;
    67import java.util.List;
    78
     
    2425
    2526    @BeforeClass
    26     public static void loadData() throws FileNotFoundException, IllegalDataException {
     27    public static void loadData() throws IllegalDataException, IOException {
    2728        Main.initApplicationPreferences();
    2829        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
    29         testDataset = OsmReader.parseDataSet(new FileInputStream("data_nodist/relation_sort.osm"), NullProgressMonitor.INSTANCE);
     30        try (InputStream fis = new FileInputStream("data_nodist/relation_sort.osm")) {
     31            testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
     32        }
    3033    }
    3134
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java

    r7005 r7033  
    33
    44import java.io.FileInputStream;
    5 import java.io.FileNotFoundException;
     5import java.io.IOException;
     6import java.io.InputStream;
    67import java.util.Arrays;
    78import java.util.List;
     
    2526
    2627    @BeforeClass
    27     public static void loadData() throws FileNotFoundException, IllegalDataException {
     28    public static void loadData() throws IllegalDataException, IOException {
    2829        Main.initApplicationPreferences();
    2930        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
    30         testDataset = OsmReader.parseDataSet(new FileInputStream("data_nodist/relation_sort.osm"), NullProgressMonitor.INSTANCE);
     31        try (InputStream fis = new FileInputStream("data_nodist/relation_sort.osm")) {
     32            testDataset = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
     33        }
    3134    }
    3235
Note: See TracChangeset for help on using the changeset viewer.