Changeset 8910 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2015-10-19T20:25:49+02:00 (9 years ago)
Author:
Don-vip
Message:

add unit test for ConflictAddCommand

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

Legend:

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

    r8510 r8910  
    2222 */
    2323public class ConflictAddCommand extends Command {
    24     private Conflict<? extends OsmPrimitive> conflict;
     24    private final Conflict<? extends OsmPrimitive> conflict;
    2525
    2626    /**
     
    6161    @Override
    6262    public void undoCommand() {
    63         if (!Main.map.mapView.hasLayer(getLayer())) {
     63        if (Main.map != null && !Main.map.mapView.hasLayer(getLayer())) {
    6464            Main.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.",
    6565                    getLayer().getName(),
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java

    r8510 r8910  
    2020public abstract class ConflictResolveCommand extends Command {
    2121    /** the list of resolved conflicts */
    22     private ConflictCollection resolvedConflicts;
     22    private final ConflictCollection resolvedConflicts;
    2323
    2424    /**
  • trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java

    r8510 r8910  
    2121
    2222    /** the conflict to resolve */
    23     private Conflict<? extends OsmPrimitive> conflict;
     23    private final Conflict<? extends OsmPrimitive> conflict;
    2424
    2525    /** the merge decision */
  • trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java

    r8456 r8910  
    2121
    2222    /** the conflict to resolve */
    23     private Conflict<? extends OsmPrimitive> conflict;
     23    private final Conflict<? extends OsmPrimitive> conflict;
    2424
    2525    /** the merge decision */
  • trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java

    r8510 r8910  
    2222
    2323    /** the conflict to resolve */
    24     private Conflict<? extends OsmPrimitive> conflict;
     24    private final Conflict<? extends OsmPrimitive> conflict;
    2525
    2626    /**
  • trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java

    r8509 r8910  
    2222public class TagConflictResolveCommand extends ConflictResolveCommand {
    2323    /** the conflict to resolve */
    24     private Conflict<? extends OsmPrimitive> conflict;
     24    private final Conflict<? extends OsmPrimitive> conflict;
    2525
    2626    /** the list of merge decisions, represented as {@link TagMergeItem}s */
  • trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java

    r8510 r8910  
    2222
    2323    /** the conflict to resolve */
    24     private Conflict<? extends OsmPrimitive> conflict;
     24    private final Conflict<? extends OsmPrimitive> conflict;
    2525
    2626    /**
  • trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java

    r8456 r8910  
    2222public class WayNodesConflictResolverCommand extends ConflictResolveCommand {
    2323    /** the conflict to resolve */
    24     private Conflict<Way> conflict;
     24    private final Conflict<Way> conflict;
    2525
    2626    /** the list of merged nodes. This becomes the list of news of my way after the
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r8855 r8910  
    8989import org.openstreetmap.josm.gui.util.GuiHelper;
    9090import org.openstreetmap.josm.gui.widgets.JosmTextArea;
     91import org.openstreetmap.josm.tools.CheckParameterUtil;
    9192import org.openstreetmap.josm.tools.FilteredCollection;
    9293import org.openstreetmap.josm.tools.GBC;
     
    246247     */
    247248    public static Color getBackgroundColor() {
    248         return Main.pref.getColor(marktr("background"), Color.BLACK);
     249        return Main.pref != null ? Main.pref.getColor(marktr("background"), Color.BLACK) : Color.BLACK;
    249250    }
    250251
     
    254255     */
    255256    public static Color getOutsideColor() {
    256         return Main.pref.getColor(marktr("outside downloaded area"), Color.YELLOW);
     257        return Main.pref != null ? Main.pref.getColor(marktr("outside downloaded area"), Color.YELLOW) : Color.YELLOW;
    257258    }
    258259
     
    281282    public OsmDataLayer(final DataSet data, final String name, final File associatedFile) {
    282283        super(name);
     284        CheckParameterUtil.ensureParameterNotNull(data, "data");
    283285        this.data = data;
    284286        this.setAssociatedFile(associatedFile);
Note: See TracChangeset for help on using the changeset viewer.