Changeset 13435 in josm


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

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

Location:
trunk
Files:
12 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)) {
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java

    r12568 r13435  
    1212import org.junit.Rule;
    1313import org.junit.Test;
     14import org.openstreetmap.josm.data.osm.DataSet;
    1415import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1516import org.openstreetmap.josm.data.osm.OsmUtils;
     
    3334
    3435    List<TestError> test(OsmPrimitive primitive) throws IOException {
     36        new DataSet(primitive);
    3537        final TagChecker checker = new TagChecker();
    3638        checker.initialize();
  • trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryBrowserModelTest.java

    r11647 r13435  
    3131    @Rule
    3232    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    33     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
     33    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
    3434
    3535    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/history/HistoryLoadTaskTest.java

    r10962 r13435  
    3737    @Rule
    3838    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    39     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
     39    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
    4040
    4141    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java

    r12743 r13435  
    2525    @Rule
    2626    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
     27    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
    2828
    2929    /**
  • trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java

    r10976 r13435  
    2828    @Rule
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
     30    public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
    3131
    3232    /**
Note: See TracChangeset for help on using the changeset viewer.