Ignore:
Timestamp:
2017-09-04T23:45:49+02:00 (7 years ago)
Author:
Don-vip
Message:

see #13036 - deprecate Command() default constructor, fix unit tests and java warnings

File:
1 edited

Legend:

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

    r12718 r12726  
    2828    /**
    2929     * Constructs a new {@code ConflictResolveCommand} in the context of the current edit layer, if any.
     30     * @deprecated to be removed end of 2017. Use {@link #ConflictResolveCommand(DataSet)} instead
    3031     */
     32    @Deprecated
    3133    public ConflictResolveCommand() {
    32         // Do nothing
     34        this(Main.main.getEditDataSet());
    3335    }
    3436
     
    8183
    8284        DataSet ds = getAffectedDataSet();
    83         if (!Main.main.containsDataSet(ds)) {
    84             Logging.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
    85                     this.toString(),
    86                     ds.getName()
    87             ));
    88             return;
     85        if (Main.main != null) {
     86            if (!Main.main.containsDataSet(ds)) {
     87                Logging.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
     88                        this.toString(),
     89                        ds.getName()
     90                ));
     91                return;
     92            }
     93
     94            Main.main.setEditDataSet(ds);
    8995        }
    90 
    91         Main.main.setEditDataSet(ds);
    9296        reconstituteConflicts();
    9397    }
Note: See TracChangeset for help on using the changeset viewer.