Changeset 14341 in josm for trunk


Ignore:
Timestamp:
2018-10-17T02:57:45+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16755 - fix sonarqube warnings

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

Legend:

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

    r14338 r14341  
    5858         * Whether the checkbox is ticked
    5959         */
    60         public boolean checkboxTicked = false;
     60        public boolean checkboxTicked;
    6161
    6262        /**
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r14338 r14341  
    260260    static class GpxTrackSegmentSpan {
    261261
    262         public final Date firstTime;
    263         public final Date lastTime;
     262        final Date firstTime;
     263        final Date lastTime;
    264264        private final boolean inv;
    265265        private final WayPoint firstWp;
     
    283283        }
    284284
    285         public WayPoint getFirstWp() {
     285        WayPoint getFirstWp() {
    286286            return new WayPoint(firstWp);
    287287        }
    288288
    289         public WayPoint getLastWp() {
     289        WayPoint getLastWp() {
    290290            return new WayPoint(lastWp);
    291291        }
     
    293293        // no new instances needed, therefore own methods for that
    294294
    295         public boolean firstEquals(Object other) {
     295        boolean firstEquals(Object other) {
    296296            return firstWp.equals(other);
    297297        }
    298298
    299         public boolean lastEquals(Object other) {
     299        boolean lastEquals(Object other) {
    300300            return lastWp.equals(other);
    301301        }
     
    305305        }
    306306
    307         public boolean overlapsWith(GpxTrackSegmentSpan other) {
     307        boolean overlapsWith(GpxTrackSegmentSpan other) {
    308308            return (firstTime.before(other.lastTime) && other.firstTime.before(lastTime))
    309309                || (other.firstTime.before(lastTime) && firstTime.before(other.lastTime));
    310310        }
    311311
    312         public static GpxTrackSegmentSpan tryGetFromSegment(GpxTrackSegment seg) {
     312        static GpxTrackSegmentSpan tryGetFromSegment(GpxTrackSegment seg) {
    313313            WayPoint b = getNextWpWithTime(seg, true);
    314314            if (b != null) {
     
    348348                }
    349349            }
    350             segSpans.sort((o1, o2) -> {
    351                 return o1.firstTime.compareTo(o2.firstTime);
    352             });
     350            segSpans.sort((o1, o2) -> o1.firstTime.compareTo(o2.firstTime));
    353351        }
    354352        return segSpans;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/MergeGpxLayerDialog.java

    r14338 r14341  
    4343    private final JTable t;
    4444    private final JCheckBox c;
    45     private final Component parent;
    4645    private final JButton btnUp;
    4746    private final JButton btnDown;
     
    5554        super(parent, tr("Merge GPX layers"), tr("Merge"), tr("Cancel"));
    5655        setButtonIcons("dialogs/mergedown", "cancel");
    57         this.parent = parent;
    5856
    5957        JPanel p = new JPanel(new GridBagLayout());
     
    137135                    && (!ConditionalOptionPaneUtil.showConfirmationDialog(
    138136                            "gpx_target_change",
    139                             parent,
     137                            getParent(),
    140138                            new JLabel("<html>" +
    141139                                    tr("This will change the target layer to \"{0}\".<br>Would you like to continue?",
     
    185183        public int getRowCount() {
    186184            return layers.size();
    187 
    188         }
    189 
    190         public void moveRow(int row, int newRow) {
     185        }
     186
     187        void moveRow(int row, int newRow) {
    191188            Collections.swap(layers, row, newRow);
    192189        }
    193190
    194         public List<GpxLayer> getSortedLayers() {
     191        List<GpxLayer> getSortedLayers() {
    195192            return layers;
    196193        }
     
    210207            case 2:
    211208                return layers.get(row).data.getTrackSegsCount();
     209            default:
     210                throw new IndexOutOfBoundsException(Integer.toString(col));
    212211            }
    213             throw new IndexOutOfBoundsException(Integer.toString(col));
    214212        }
    215213    }
Note: See TracChangeset for help on using the changeset viewer.