Changeset 17917 in josm for trunk/src


Ignore:
Timestamp:
2021-06-02T20:41:00+02:00 (3 years ago)
Author:
simon04
Message:

Cascade.convertTo: use Class.cast to avoid unchecked warning

File:
1 edited

Legend:

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

    r16436 r17917  
    142142     * @return The converted object or <code>null</code> if the conversion failed
    143143     */
    144     @SuppressWarnings("unchecked")
    145144    public static <T> T convertTo(Object o, Class<T> klass) {
    146145        if (o == null)
    147146            return null;
    148147        if (klass.isInstance(o))
    149             return (T) o;
     148            return klass.cast(o);
    150149
    151150        return GENERIC_PARSER.supports(klass)
Note: See TracChangeset for help on using the changeset viewer.