Ignore:
Timestamp:
2014-05-09T05:21:14+02:00 (11 years ago)
Author:
donvip
Message:

[josm_plugins] see #josm8465 - Java 7 code update

Location:
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java

    r29531 r30436  
    5656import org.openstreetmap.josm.plugins.piclayer.actions.SavePictureCalibrationAction;
    5757import org.openstreetmap.josm.plugins.piclayer.transform.PictureTransform;
    58 import org.openstreetmap.josm.tools.Utils;
    5958
    6059/**
     
    457456
    458457    public void loadWorldfile(InputStream is) throws IOException {
    459         BufferedReader br = null;
    460         try {
     458       
     459        try (
    461460            Reader reader = new InputStreamReader(is);
    462             br = new BufferedReader(reader);
     461            BufferedReader br = new BufferedReader(reader)
     462        ) {
    463463            double e[] = new double[6];
    464464            for (int i=0; i<6; ++i) {
     
    488488            initialImageScale = 1;
    489489            Main.map.mapView.repaint();
    490         } finally {
    491             Utils.close(br);
    492490        }
    493491    }
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java

    r27120 r30436  
    2323import static org.openstreetmap.josm.tools.I18n.tr;
    2424
    25 import org.openstreetmap.josm.Main;
    26 
    2725import java.awt.Image;
    2826import java.io.File;
     
    3836import javax.swing.JOptionPane;
    3937
    40 import org.openstreetmap.josm.tools.Utils;
     38import org.openstreetmap.josm.Main;
    4139/**
    4240 * Layer displaying a picture loaded from a file.
     
    9694                if (imgEntry != null) {
    9795                    imgNameInZip = imgEntry.getName();
    98                     InputStream is = null;
    99                     try {
    100                         is = zipFile.getInputStream(imgEntry);
    101                         image = ImageIO.read(is);
    102                         return image;
    103                     } finally {
    104                         Utils.close(is);
     96                    try (InputStream is = zipFile.getInputStream(imgEntry)) {
     97                        return ImageIO.read(is);
    10598                    }
    10699                }
Note: See TracChangeset for help on using the changeset viewer.