Changeset 11111 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2016-10-09T23:25:02+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S2095 - Resources should be closed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r11087 r11111  
    22package org.openstreetmap.josm.data.validation.tests;
    33
    4 import static org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.FixCommand.evaluateObject;
    54import static org.openstreetmap.josm.tools.I18n.tr;
    65
     
    717716    public synchronized ParseResult addMapCSS(String url) throws ParseException, IOException {
    718717        CheckParameterUtil.ensureParameterNotNull(url, "url");
    719         CachedFile cache = new CachedFile(url);
    720         InputStream zip = cache.findZipEntryInputStream("validator.mapcss", "");
    721718        ParseResult result;
    722         try (InputStream s = zip != null ? zip : cache.getInputStream()) {
     719        try (CachedFile cache = new CachedFile(url);
     720             InputStream zip = cache.findZipEntryInputStream("validator.mapcss", "");
     721             InputStream s = zip != null ? zip : cache.getInputStream()) {
    723722            result = TagCheck.readMapCSS(new BufferedReader(UTFInputStreamReader.create(s)));
    724723            checks.remove(url);
     
    730729                }
    731730            }
    732         } finally {
    733             cache.close();
    734731        }
    735732        return result;
Note: See TracChangeset for help on using the changeset viewer.