Ignore:
Timestamp:
2014-10-19T01:27:04+02:00 (11 years ago)
Author:
donvip
Message:

[josm_plugins] fix java 7 warnings / global usage of try-with-resource

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java

    r28961 r30738  
    2222    private CadastreInterface wmsInterface = new CadastreInterface();
    2323
    24     public GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax) throws IOException, OsmTransferException {
    25 
     24    public GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax)
     25            throws IOException, OsmTransferException {
    2626        try {
    2727            URL url = null;
     
    8888        wmsInterface.urlConn.setRequestMethod("GET");
    8989        wmsInterface.setCookie();
    90         InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE);
    91         BufferedImage img = ImageIO.read(is);
    92         is.close();
    93         return img;
     90        try (InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE)) {
     91            return ImageIO.read(is);
     92        }
    9493    }
    9594
     
    9796        return wmsInterface;
    9897    }
    99 
    10098}
Note: See TracChangeset for help on using the changeset viewer.