Index: applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAlgnSegment.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAlgnSegment.java	(revision 32466)
+++ applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAlgnSegment.java	(revision 32920)
@@ -26,5 +26,5 @@
 /**
  * @author tilusnet <tilusnet@gmail.com>
- * 
+ *
  * The segment to be aligned to the reference segment. Actions it can do:
  *         - remember its selected pivot point
@@ -32,5 +32,5 @@
  *         - rotate itself
  *         - paint itself and its selected pivot point
- * 
+ *
  */
 public class AlignWaysAlgnSegment extends AlignWaysSegment {
@@ -109,5 +109,5 @@
      * Returns the EastNorth of the specified pivot point pp. It always returns
      * up-to-date data from dataset. Assumes segment is not null.
-     * 
+     *
      * @param pp
      *            The pivot location
@@ -177,5 +177,5 @@
      * Given a Node (usually an endpoint), it will return a collection of way segments that are adjacently
      * connected to it. The current alignee waysegment is not added to the collection.
-     * 
+     *
      * @param node The Node (endpoint) to analyse.
      * @return The collection of the adjacent waysegments.
@@ -194,5 +194,5 @@
             Point pnew = new Point();
             pnew.setLocation(x, y);
-            WaySegment ws = Main.map.mapView.getNearestWaySegment(pnew, OsmPrimitive.isUsablePredicate);
+            WaySegment ws = Main.map.mapView.getNearestWaySegment(pnew, OsmPrimitive::isUsable);
             if (ws != null &&  !ws.equals(this.segment) &&
                     (ws.getFirstNode().equals(node) || ws.getSecondNode().equals(node))) {
@@ -211,5 +211,5 @@
      * The node is normally a valid endpoint of the segment.
      * If it isn't, null may be returned.
-     * 
+     *
      * @param node The (endpoint) node.
      * @return Collection of the adjacent way segments.
Index: applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysMode.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysMode.java	(revision 32466)
+++ applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysMode.java	(revision 32920)
@@ -1,4 +1,4 @@
 /**
- * 
+ *
  */
 package com.tilusnet.josm.plugins.alignways;
@@ -29,5 +29,5 @@
  * @author tilusnet <tilusnet@gmail.com>
  * Handles the state machine and user interaction (mouse clicks).
- * 
+ *
  */
 public class AlignWaysMode extends MapMode /* implements MapViewPaintable */{
@@ -209,7 +209,5 @@
 
         Main.pref.put("alignways.showtips", !atp.isChkBoxSelected());
-
-    }
-
+    }
 
     private void showWhatsNew() {
@@ -226,6 +224,5 @@
         wnDialog.dispose();
 
-        Main.pref.put("alignways.majorver", new Integer(AlignWaysPlugin.AlignWaysMajorVersion).toString());
-
+        Main.pref.put("alignways.majorver", Integer.toString(AlignWaysPlugin.AlignWaysMajorVersion));
     }
 
Index: applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java	(revision 32466)
+++ applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegment.java	(revision 32920)
@@ -1,4 +1,4 @@
 /**
- * 
+ *
  */
 package com.tilusnet.josm.plugins.alignways;
@@ -23,5 +23,5 @@
 /**
  * @author tilusnet <tilusnet@gmail.com>
- * 
+ *
  */
 public class AlignWaysSegment implements MapViewPaintable {
@@ -60,12 +60,9 @@
             segmentEndPoints.add(node1);
             segmentEndPoints.add(node2);
-
         }
     }
 
     protected WaySegment getNearestWaySegment(Point p) {
-
-        return mapview.getNearestWaySegment(p, OsmPrimitive.isUsablePredicate);
-
+        return mapview.getNearestWaySegment(p, OsmPrimitive::isUsable);
     }
 
Index: applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysWhatsNewPanel.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysWhatsNewPanel.java	(revision 32466)
+++ applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysWhatsNewPanel.java	(revision 32920)
@@ -1,4 +1,4 @@
 /**
- * 
+ *
  */
 package com.tilusnet.josm.plugins.alignways;
@@ -46,6 +46,6 @@
         newItem2 = new javax.swing.JLabel();
 
-        lblWhatsNew.setText("<html><div style=\"font-family: sans-serif; font-weight: bold; font-style: italic;\"><span style=\"font-size: large;\"><span style=\"font-size: x-large;\">" 
-                            + tr("What''s new...") 
+        lblWhatsNew.setText("<html><div style=\"font-family: sans-serif; font-weight: bold; font-style: italic;\"><span style=\"font-size: large;\"><span style=\"font-size: x-large;\">"
+                            + tr("What''s new...")
                             + "</span></div></html>");
 
@@ -53,5 +53,5 @@
 
         newItem1.setText("<html><div style=\"font-family: sans-serif;\"><ul style=\"margin-left: 20px;\"><li>"
-                         + tr("Added <b>angle preserving</b> aligning mode") 
+                         + tr("Added <b>angle preserving</b> aligning mode")
                          + "</li></ul></div></html>");
 
@@ -67,4 +67,5 @@
         btnHelpItem1.setPreferredSize(new java.awt.Dimension(69, 25));
         btnHelpItem1.addActionListener(new java.awt.event.ActionListener() {
+            @Override
             public void actionPerformed(java.awt.event.ActionEvent evt) {
                 btnHelpItem1ActionPerformed(evt);
@@ -136,12 +137,12 @@
           } catch (URISyntaxException ex) {
                 Logger.getLogger(AlignWaysWhatsNewPanel.class.getName()).log(Level.SEVERE, null, ex);
-          } catch (IOException e) { 
+          } catch (IOException e) {
               JOptionPane.showMessageDialog(this, e, tr("Errr..."), JOptionPane.WARNING_MESSAGE);
           }
-        } else { 
+        } else {
              JOptionPane.showMessageDialog(this, tr("Browser not supported."), tr("Errr..."), JOptionPane.WARNING_MESSAGE);
         }
     }
-    
+
     /*** End of Matisse generated code section ***/
 
Index: applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/geometry/AlignWaysGeomLine.java
===================================================================
--- applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/geometry/AlignWaysGeomLine.java	(revision 32466)
+++ applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/geometry/AlignWaysGeomLine.java	(revision 32920)
@@ -1,4 +1,5 @@
 package com.tilusnet.josm.plugins.alignways.geometry;
 
+import java.util.Objects;
 
 /**
@@ -131,37 +132,34 @@
     /**
      * Get the Y coordinate on the line of a point with the given X coordinate.
-     * 
-     * @param X The x-coordinate of the given point.
+     *
+     * @param x The x-coordinate of the given point.
      * @return The calculated y-coordinate or Double.NaN if the line is vertical.
      */
-    public Double getYonLine(double X) {
-
-        Double Y = new Double((-coef_a*X - coef_c)/coef_b);
-
-        if (Y.isInfinite() || Y.isNaN())
+    public Double getYonLine(double x) {
+
+        Double y = Double.valueOf((-coef_a*x - coef_c)/coef_b);
+
+        if (y.isInfinite() || y.isNaN())
             // Vertical line
             return Double.NaN;
         else
-            return Y;
-
-    }
-
+            return y;
+    }
 
     /**
      * Get the X coordinate on the line of a point with the given Y coordinate.
-     * 
-     * @param Y The y-coordinate of the given point.
+     *
+     * @param y The y-coordinate of the given point.
      * @return The calculated x-coordinate or Double.NaN if the line is horizontal.
      */
-    public Double getXonLine(double Y) {
-
-        Double X = new Double((-coef_b*Y - coef_c)/coef_a);
-
-        if (X.isInfinite() || X.isNaN())
+    public Double getXonLine(double y) {
+
+        Double x = Double.valueOf((-coef_b*y - coef_c)/coef_a);
+
+        if (x.isInfinite() || x.isNaN())
             // Horizontal line
             return Double.NaN;
         else
-            return X;
-
+            return x;
     }
 
@@ -184,4 +182,9 @@
     }
 
+    @Override
+    public int hashCode() {
+        return Objects.hash(coef_a, coef_b, coef_c);
+    }
+
     public boolean isPointOnLine(AlignWaysGeomPoint awPt) {
         // Method:
@@ -189,10 +192,10 @@
         // 2. check getIntersectionStatus of the two lines
         // 3. if status is LINES_OVERLAP, the point os one the line, otherwise not
-        
+
         // Need an arbitrary point on this line; let it be (x, y)
         Double x = 0.0;
         Double y = getYonLine(x);
         if (y.isNaN()) y = 0.0;
-        
+
         AlignWaysGeomLine line2 = new AlignWaysGeomLine(awPt, new AlignWaysGeomPoint(x, y));
         getIntersection(line2);
@@ -201,5 +204,5 @@
         else
             return false;
-        
+
     }
 
