Ignore:
Timestamp:
2017-11-28T00:56:29+01:00 (23 months ago)
Author:
Don-vip
Message:

see #15310 - remove most of deprecated APIs

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java

    r12822 r13173  
    55import java.util.function.Predicate;
    66import java.util.function.Supplier;
    7 
    8 import org.openstreetmap.josm.data.coor.EastNorth;
    9 import org.openstreetmap.josm.data.coor.LatLon;
    10 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    11 import org.openstreetmap.josm.data.osm.PrimitiveId;
    127
    138/**
     
    6560
    6661    /**
    67      * Ensures an OSM primitive ID is valid
    68      * @param id The id to check
    69      * @param parameterName The parameter name
    70      * @throws IllegalArgumentException if the primitive ID is not valid (negative or zero)
    71      * @deprecated use {@link #ensure(Object, String, String, Predicate)}
    72      */
    73     @Deprecated
    74     public static void ensureValidPrimitiveId(PrimitiveId id, String parameterName) {
    75         ensureParameterNotNull(id, parameterName);
    76         if (id.getUniqueId() <= 0)
    77             throw new IllegalArgumentException(
    78                     MessageFormat.format("Expected unique id > 0 for primitive ''{1}'', got {0}", id.getUniqueId(), parameterName));
    79     }
    80 
    81     /**
    82      * Ensures lat/lon coordinates are valid
    83      * @param latlon The lat/lon to check
    84      * @param parameterName The parameter name
    85      * @throws IllegalArgumentException if the lat/lon are {@code null} or not valid
    86      * @since 5980
    87      * @deprecated use {@link #ensure(Object, String, Predicate)}
    88      */
    89     @Deprecated
    90     public static void ensureValidCoordinates(LatLon latlon, String parameterName) {
    91         ensureParameterNotNull(latlon, parameterName);
    92         if (!latlon.isValid())
    93             throw new IllegalArgumentException(
    94                     MessageFormat.format("Expected valid lat/lon for parameter ''{0}'', got {1}", parameterName, latlon));
    95     }
    96 
    97     /**
    98      * Ensures east/north coordinates are valid
    99      * @param eastnorth The east/north to check
    100      * @param parameterName The parameter name
    101      * @throws IllegalArgumentException if the east/north are {@code null} or not valid
    102      * @since 5980
    103      * @deprecated use {@link #ensure(Object, String, Predicate)}
    104      */
    105     @Deprecated
    106     public static void ensureValidCoordinates(EastNorth eastnorth, String parameterName) {
    107         ensureParameterNotNull(eastnorth, parameterName);
    108         if (!eastnorth.isValid())
    109             throw new IllegalArgumentException(
    110                     MessageFormat.format("Expected valid east/north for parameter ''{0}'', got {1}", parameterName, eastnorth));
    111     }
    112 
    113     /**
    114      * Ensures a version number is valid
    115      * @param version The version to check
    116      * @param parameterName The parameter name
    117      * @throws IllegalArgumentException if the version is not valid (negative)
    118      * @deprecated use {@link #ensure(Object, String, String, Predicate)}
    119      */
    120     @Deprecated
    121     public static void ensureValidVersion(long version, String parameterName) {
    122         if (version < 0)
    123             throw new IllegalArgumentException(
    124                     MessageFormat.format("Expected value of type long > 0 for parameter ''{0}'', got {1}", parameterName, version));
    125     }
    126 
    127     /**
    12862     * Ensures a parameter is not {@code null}
    12963     * @param value The parameter to check
     
    174108            throw new IllegalArgumentException(messageSupplier.get());
    175109    }
    176 
    177     /**
    178      * Ensures that <code>id</code> is non-null primitive id of type {@link OsmPrimitiveType#NODE}
    179      *
    180      * @param id the primitive  id
    181      * @param parameterName the name of the parameter to be checked
    182      * @throws IllegalArgumentException if id is null
    183      * @throws IllegalArgumentException if id.getType() != NODE
    184      * @deprecated use {@link #ensure(Object, String, String, Predicate)}
    185      */
    186     @Deprecated
    187     public static void ensureValidNodeId(PrimitiveId id, String parameterName) {
    188         ensureParameterNotNull(id, parameterName);
    189         if (!id.getType().equals(OsmPrimitiveType.NODE))
    190             throw new IllegalArgumentException(
    191                     MessageFormat.format("Parameter ''{0}'' of type node expected, got ''{1}''", parameterName, id.getType().getAPIName()));
    192     }
    193110}
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r12987 r13173  
    5959import java.util.regex.Pattern;
    6060import java.util.stream.Stream;
    61 import java.util.zip.GZIPInputStream;
    6261import java.util.zip.ZipFile;
    63 import java.util.zip.ZipInputStream;
    6462
    6563import javax.xml.XMLConstants;
     
    7068import javax.xml.parsers.SAXParserFactory;
    7169
    72 import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
    73 import org.openstreetmap.josm.io.Compression;
    7470import org.openstreetmap.josm.spi.preferences.Config;
    7571import org.w3c.dom.Document;
     
    721717            }
    722718        };
    723     }
    724 
    725     /**
    726      * Returns a Bzip2 input stream wrapping given input stream.
    727      * @param in The raw input stream
    728      * @return a Bzip2 input stream wrapping given input stream, or {@code null} if {@code in} is {@code null}
    729      * @throws IOException if the given input stream does not contain valid BZ2 header
    730      * @since 7867
    731      * @deprecated use {@link Compression#getBZip2InputStream(java.io.InputStream)}
    732      */
    733     @Deprecated
    734     public static BZip2CompressorInputStream getBZip2InputStream(InputStream in) throws IOException {
    735         return Compression.getBZip2InputStream(in);
    736     }
    737 
    738     /**
    739      * Returns a Gzip input stream wrapping given input stream.
    740      * @param in The raw input stream
    741      * @return a Gzip input stream wrapping given input stream, or {@code null} if {@code in} is {@code null}
    742      * @throws IOException if an I/O error has occurred
    743      * @since 7119
    744      * @deprecated use {@link Compression#getGZipInputStream(java.io.InputStream)}
    745      */
    746     @Deprecated
    747     public static GZIPInputStream getGZipInputStream(InputStream in) throws IOException {
    748         return Compression.getGZipInputStream(in);
    749     }
    750 
    751     /**
    752      * Returns a Zip input stream wrapping given input stream.
    753      * @param in The raw input stream
    754      * @return a Zip input stream wrapping given input stream, or {@code null} if {@code in} is {@code null}
    755      * @throws IOException if an I/O error has occurred
    756      * @since 7119
    757      * @deprecated use {@link Compression#getZipInputStream(java.io.InputStream)}
    758      */
    759     @Deprecated
    760     public static ZipInputStream getZipInputStream(InputStream in) throws IOException {
    761         return Compression.getZipInputStream(in);
    762719    }
    763720
  • trunk/src/org/openstreetmap/josm/tools/template_engine/Condition.java

    r13076 r13173  
    2828    public Condition() {
    2929        this.entries = new ArrayList<>();
    30     }
    31 
    32     /**
    33      * Returns template entries.
    34      * @return template entries
    35      * @deprecated (since 13003) use constructor {@link #Condition(java.util.Collection)} to set the entries
    36      */
    37     @Deprecated
    38     public List<TemplateEntry> getEntries() {
    39         return entries;
    4030    }
    4131
Note: See TracChangeset for help on using the changeset viewer.