Index: applications/editors/josm/plugins/alignways/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/alignways/.settings/org.eclipse.jdt.ui.prefs	(revision 32920)
+++ applications/editors/josm/plugins/alignways/.settings/org.eclipse.jdt.ui.prefs	(revision 32920)
@@ -0,0 +1,59 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
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 32919)
+++ 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 32919)
+++ 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 32919)
+++ 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 32919)
+++ 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 32919)
+++ 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;
-        
+
     }
 
