Ignore:
Timestamp:
2016-12-09T23:31:13+01:00 (4 years ago)
Author:
Don-vip
Message:

sonar - squid:S00112 - Generic exceptions should never be thrown: define JosmRuntimeException

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    r11240 r11374  
    1919import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2020import org.openstreetmap.josm.tools.CheckParameterUtil;
     21import org.openstreetmap.josm.tools.JosmRuntimeException;
    2122
    2223/**
     
    170171            OsmPrimitive osm = getAffectedDataSet().getPrimitiveById(d);
    171172            if (osm == null)
    172                 throw new RuntimeException();
     173                throw new JosmRuntimeException("No primitive found for " + d);
    173174            prims.add(osm);
    174175        }
     
    188189        AddPrimitivesCommand that = (AddPrimitivesCommand) obj;
    189190        return Objects.equals(data, that.data) &&
    190                 Objects.equals(toSelect, that.toSelect) &&
    191                 Objects.equals(createdPrimitives, that.createdPrimitives) &&
    192                 Objects.equals(createdPrimitivesToSelect, that.createdPrimitivesToSelect);
     191               Objects.equals(toSelect, that.toSelect) &&
     192               Objects.equals(createdPrimitives, that.createdPrimitives) &&
     193               Objects.equals(createdPrimitivesToSelect, that.createdPrimitivesToSelect);
    193194    }
    194195}
Note: See TracChangeset for help on using the changeset viewer.