Changeset 7050 in josm for trunk/src


Ignore:
Timestamp:
2014-05-02T03:01:08+02:00 (6 years ago)
Author:
Don-vip
Message:

sonar - Nullcheck of value previously dereferenced

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r7024 r7050  
    8383import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
    8484import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
     85import org.openstreetmap.josm.tools.CheckParameterUtil;
    8586import org.openstreetmap.josm.tools.ImageProvider;
    8687import org.openstreetmap.josm.tools.Shortcut;
     
    736737    }
    737738
    738     public static Command addPrimitivesToRelation(final Relation orig, Collection<? extends OsmPrimitive> primitivesToAdd) {
     739    public static Command addPrimitivesToRelation(final Relation orig, Collection<? extends OsmPrimitive> primitivesToAdd) throws IllegalArgumentException {
     740        CheckParameterUtil.ensureParameterNotNull(orig, "orig");
    739741        try {
    740742            final Collection<TaggingPreset> presets = TaggingPreset.getMatchingPresets(EnumSet.of(TaggingPresetType.RELATION), orig.getKeys(), false);
     
    742744            boolean modified = false;
    743745            for (OsmPrimitive p : primitivesToAdd) {
    744                 if (p instanceof Relation && orig != null && orig.equals(p)) {
     746                if (p instanceof Relation && orig.equals(p)) {
    745747                    warnOfCircularReferences(p);
    746748                    continue;
  • trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java

    r7033 r7050  
    264264            visitor.merge();
    265265            ret = visitor.getTargetDataSet();
    266             readIncompletePrimitives(ret, progressMonitor.createSubTaskMonitor(1, false));
    267266            if (ret != null) {
     267                readIncompletePrimitives(ret, progressMonitor.createSubTaskMonitor(1, false));
    268268                ret.deleteInvisible();
    269269            }
Note: See TracChangeset for help on using the changeset viewer.