Ignore:
Timestamp:
2013-10-03T03:41:25+02:00 (13 years ago)
Author:
Don-vip
Message:

Sonar/Findbugs - fix various problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java

    r6148 r6289  
    1919import org.openstreetmap.josm.gui.preferences.SourceEntry;
    2020import org.openstreetmap.josm.tools.ImageProvider;
     21import org.openstreetmap.josm.tools.Utils;
    2122
    2223abstract public class StyleSource extends SourceEntry {
     
    4748    abstract public void loadStyleSource();
    4849
     50    /**
     51     * Returns a new {@code InputStream} to the style source. When finished, {@link #closeSourceInputStream(InputStream)} must be called.
     52     * @return A new {@code InputStream} to the style source that must be closed by the caller
     53     * @throws IOException if any I/O error occurs.
     54     * @see #closeSourceInputStream(InputStream)
     55     */
    4956    abstract public InputStream getSourceInputStream() throws IOException;
     57
     58    /**
     59     * Closes the source input stream previously returned by {@link #getSourceInputStream()} and other linked resources, if applicable.
     60     * @param is The source input stream that must be closed
     61     * @since 6289
     62     * @see #getSourceInputStream()
     63     */
     64    public void closeSourceInputStream(InputStream is) {
     65        Utils.close(is);
     66    }
    5067
    5168    public void logError(Throwable e) {
Note: See TracChangeset for help on using the changeset viewer.