Changeset 32917 in osm


Ignore:
Timestamp:
2016-09-03T21:48:17+02:00 (8 years ago)
Author:
donvip
Message:

fix error-prone warnings

Location:
applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/DrawSplineAction.java

    r32547 r32917  
    2929import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
    3030import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
     31import org.openstreetmap.josm.data.preferences.ColorProperty;
    3132import org.openstreetmap.josm.gui.MapFrame;
    3233import org.openstreetmap.josm.gui.MapView;
     
    105106    @Override
    106107    protected void readPreferences() {
    107         rubberLineColor = Main.pref.getColor(marktr("helper line"), null);
     108        rubberLineColor = new ColorProperty(marktr("helper line"), (Color) null).get();
    108109        if (rubberLineColor == null)
    109110            rubberLineColor = PaintColors.SELECTED.get();
     
    215216        boolean existing = false;
    216217        if (!ctrl) {
    217             n = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive.isUsablePredicate);
     218            n = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive::isUsable);
    218219            existing = true;
    219220        }
     
    278279        } else {
    279280            if (dragControl) {
    280                 Main.main.undoRedo.add(spl.new EditSplineCommand(ph.sn));
     281                Main.main.undoRedo.add(new Spline.EditSplineCommand(ph.sn));
    281282                dragControl = false;
    282283            }
     
    312313                Node n = null;
    313314                if (!ctrl)
    314                     n = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive.isUsablePredicate);
     315                    n = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive::isUsable);
    315316                if (n == null) {
    316317                    redraw = removeHighlighting();
     
    396397    }
    397398
    398     public class BackSpaceAction extends AbstractAction {
     399    public static class BackSpaceAction extends AbstractAction {
    399400        @Override
    400401        public void actionPerformed(ActionEvent e) {
  • applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/Spline.java

    r32547 r32917  
    1818import java.util.LinkedList;
    1919import java.util.List;
     20import java.util.Objects;
    2021
    2122import javax.swing.Icon;
     
    187188            PointHandle o = (PointHandle) other;
    188189            return this.sn == o.sn && this.point == o.point;
     190        }
     191
     192        @Override
     193        public int hashCode() {
     194            return Objects.hash(sn, point);
    189195        }
    190196    }
     
    406412    }
    407413
    408     public class EditSplineCommand extends Command {
     414    public static class EditSplineCommand extends Command {
    409415        EastNorth cprev;
    410416        EastNorth cnext;
Note: See TracChangeset for help on using the changeset viewer.