Ignore:
Timestamp:
2017-04-01T01:23:56+02:00 (3 years ago)
Author:
Don-vip
Message:

findbugs - BC_UNCONFIRMED_CAST

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r11702 r11809  
    211211     */
    212212    public MultiFetchServerObjectReader append(OsmPrimitive primitive) {
    213         if (primitive != null) {
    214             switch (OsmPrimitiveType.from(primitive)) {
    215                 case NODE: return appendNode((Node) primitive);
    216                 case WAY: return appendWay((Way) primitive);
    217                 case RELATION: return appendRelation((Relation) primitive);
    218                 default: break;
    219             }
     213        if (primitive instanceof Node) {
     214            return appendNode((Node) primitive);
     215        } else if (primitive instanceof Way) {
     216            return appendWay((Way) primitive);
     217        } else if (primitive instanceof Relation) {
     218            return appendRelation((Relation) primitive);
    220219        }
    221220        return this;
  • trunk/src/org/openstreetmap/josm/io/OsmExporter.java

    r11386 r11809  
    6464     */
    6565    public void exportData(File file, Layer layer, boolean noBackup) {
    66         checkOsmDataLayer(layer);
     66        if (!(layer instanceof OsmDataLayer)) {
     67            throw new IllegalArgumentException(
     68                    MessageFormat.format("Expected instance of OsmDataLayer. Got ''{0}''.", layer.getClass().getName()));
     69        }
    6770        save(file, (OsmDataLayer) layer, noBackup);
    68     }
    69 
    70     protected static void checkOsmDataLayer(Layer layer) {
    71         if (!(layer instanceof OsmDataLayer)) {
    72             throw new IllegalArgumentException(MessageFormat.format("Expected instance of OsmDataLayer. Got ''{0}''.", layer
    73                     .getClass().getName()));
    74         }
    7571    }
    7672
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/DNSName.java

    r9344 r11809  
    203203            constraintType = NAME_DIFF_TYPE;
    204204        else {
     205            if (!(inputName instanceof DNSName)) {
     206                throw new IllegalArgumentException("inputName: " + inputName);
     207            }
    205208            String inName =
    206209                (((DNSName) inputName).getName()).toLowerCase(Locale.ENGLISH);
Note: See TracChangeset for help on using the changeset viewer.