Changeset 13435 in josm for trunk/src


Ignore:
Timestamp:
2018-02-18T14:13:19+01:00 (6 years ago)
Author:
Don-vip
Message:

see #8039, see #10456 - fix regressions and code style issues

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r13434 r13435  
    251251    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
    252252        int numWays = 0;
    253         if (selection.stream().map(o -> o.getDataSet()).noneMatch(DataSet::isReadOnly)) {
     253        if (selection.stream().map(OsmPrimitive::getDataSet).noneMatch(DataSet::isReadOnly)) {
    254254            for (OsmPrimitive osm : selection) {
    255255                if (osm instanceof Way && !osm.isIncomplete() && ++numWays >= 2) {
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r13434 r13435  
    191191        /**
    192192         * Constructs a new {@code AbstractInternalTask}.
    193          *
    194193         * @param newLayer if {@code true}, force download to a new layer
    195194         * @param title message for the user
     
    207206        /**
    208207         * Constructs a new {@code AbstractInternalTask}.
    209          *
    210208         * @param newLayer if {@code true}, force download to a new layer
    211209         * @param title message for the user
     
    287285                // the user explicitly wants a new layer, we don't have any layer at all
    288286                // or it is not clear which layer to merge to
    289                 //
    290287                final OsmDataLayer layer = createNewLayer(newLayerName);
    291288                MainApplication.getLayerManager().addLayer(layer, zoomAfterDownload);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java

    r13434 r13435  
    1717import org.openstreetmap.josm.gui.NoteInputDialog;
    1818import org.openstreetmap.josm.gui.Notification;
    19 import org.openstreetmap.josm.gui.layer.Layer;
    20 import org.openstreetmap.josm.gui.layer.NoteLayer;
    2119import org.openstreetmap.josm.gui.util.KeyPressReleaseListener;
    2220import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    102100        // Do nothing
    103101    }
    104 
    105     @Override
    106     public boolean layerIsSupported(Layer l) {
    107         return l instanceof NoteLayer;
    108     }
    109102}
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r13434 r13435  
    670670            } else if (hasSelectionNearby || dragInProgress()) {
    671671                mode = Mode.MOVE;
    672             }
    673         }
    674         mode = Mode.SELECT;
     672            } else {
     673                mode = Mode.SELECT;
     674            }
     675        } else {
     676            mode = Mode.SELECT;
     677        }
    675678    }
    676679
  • trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java

    r13434 r13435  
    8989    protected void updateEnabledState() {
    9090        boolean enabled = false;
    91         if (relations.stream().map(r -> r.getDataSet()).noneMatch(DataSet::isReadOnly)) {
     91        if (relations.stream().map(Relation::getDataSet).noneMatch(DataSet::isReadOnly)) {
    9292            for (Relation r : relations) {
    9393                if (!r.isDeleted()) {
  • trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java

    r13434 r13435  
    496496     * @param layer The OsmDataLayer to be uploaded
    497497     */
    498     public void prepareLayerForUpload(OsmDataLayer layer) {
     498    public synchronized void prepareLayerForUpload(OsmDataLayer layer) {
    499499        GuiHelper.assertCallFromEdt();
    500500        layer.setUploadInProgress();
     
    516516     * @param layer The OsmDataLayer uploaded
    517517     */
    518     public void processLayerAfterUpload(OsmDataLayer layer) {
     518    public synchronized void processLayerAfterUpload(OsmDataLayer layer) {
    519519        GuiHelper.assertCallFromEdt();
    520520        layer.unsetReadOnly();
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r13434 r13435  
    11881188    }
    11891189
     1190    /**
     1191     * Sets the "upload in progress" flag, which will result in displaying a new icon and forbid to remove the layer.
     1192     * @since 13434
     1193     */
    11901194    public void setUploadInProgress() {
    11911195        if (!isUploadInProgress.compareAndSet(false, true)) {
     
    11941198    }
    11951199
     1200    /**
     1201     * Unsets the "upload in progress" flag, which will result in displaying the standard icon and allow to remove the layer.
     1202     * @since 13434
     1203     */
    11961204    public void unsetUploadInProgress() {
    11971205        if (!isUploadInProgress.compareAndSet(true, false)) {
Note: See TracChangeset for help on using the changeset viewer.