Index: applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java
===================================================================
--- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java	(revision 30641)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java	(revision 30737)
@@ -32,6 +32,6 @@
 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
 import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.gui.NavigatableComponent.SoMChangeListener;
 import org.openstreetmap.josm.gui.SideButton;
-import org.openstreetmap.josm.gui.NavigatableComponent.SoMChangeListener;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
 import org.openstreetmap.josm.gui.help.HelpUtil;
@@ -73,10 +73,10 @@
      */
     protected JLabel segAngleLabel;
-    
+
     private DataSet ds;
 
     private Collection<Way> ways;
     private Collection<Node> nodes;
-    
+
     /**
      * Constructor
@@ -131,5 +131,5 @@
             resetButton
         }));
-        
+
         DataSet.addSelectionListener(this);
         NavigatableComponent.addSoMChangeListener(this);
@@ -162,7 +162,7 @@
         Node lastNode = null;
         // Don't mix up way and nodes computation (fix #6872). Priority given to ways
-        ways = new SubclassFilteredCollection<OsmPrimitive, Way>(newSelection, OsmPrimitive.wayPredicate);
+        ways = new SubclassFilteredCollection<>(newSelection, OsmPrimitive.wayPredicate);
         if (ways.isEmpty()) {
-            nodes = new SubclassFilteredCollection<OsmPrimitive, Node>(newSelection, OsmPrimitive.nodePredicate);
+            nodes = new SubclassFilteredCollection<>(newSelection, OsmPrimitive.nodePredicate);
             for (Node n : nodes) {
                 if (n.getCoor() != null) {
@@ -198,9 +198,9 @@
             }
         }
-        
+
         final String lengthLabel = getDistText(length);
         final String angleLabel = getAngleText(segAngle);
         final String areaLabel = getAreaText(area);
-        
+
         GuiHelper.runInEDT(new Runnable() {
             @Override
@@ -211,7 +211,7 @@
             }
         });
-        
+
         DataSet currentDs = Main.main.getCurrentDataSet();
-    
+
         if (ds != currentDs) {
             if (ds != null) {
@@ -246,5 +246,5 @@
         return false;
     }
-    
+
     @Override public void nodeMoved(NodeMovedEvent event) {
         Node n = event.getNode();
Index: applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java
===================================================================
--- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java	(revision 30641)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java	(revision 30737)
@@ -52,5 +52,5 @@
 
     private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(MeasurementPlugin.class.getResource("/images/measurement.png")));
-    private Collection<WayPoint> points = new ArrayList<WayPoint>(32);
+    private Collection<WayPoint> points = new ArrayList<>(32);
 
     @Override
@@ -146,5 +146,5 @@
             last = p;
         }
-        if (MeasurementPlugin.measurementDialog != null) { 
+        if (MeasurementPlugin.measurementDialog != null) {
             MeasurementPlugin.measurementDialog.pathLengthLabel.setText(NavigatableComponent.getDistText(pathLength));
         }
@@ -153,5 +153,5 @@
         }
     }
-    
+
     /*
      * Use an equal area sinusoidal projection to improve accuracy and so we can still use normal polygon area calculation
@@ -222,5 +222,5 @@
          */
         private DefaultListModel<GpxLayer> model = new DefaultListModel<>();
-    
+
         /**
          * @param layer the targeting measurement layer
@@ -229,5 +229,5 @@
             super(tr("Import path from GPX layer"), ImageProvider.get("dialogs", "edit")); // TODO: find better image
         }
-    
+
         @Override
         public void actionPerformed(ActionEvent e) {
@@ -237,5 +237,5 @@
             Layer lastLayer = null;
             int layerCnt = 0;
-    
+
             for (Layer l : data) {
                 if (l instanceof GpxLayer) {
@@ -261,10 +261,10 @@
                     }
                 });
-    
+
                 JCheckBox dropFirst = new JCheckBox(tr("Drop existing path"));
-    
+
                 panel.add(layerList);
                 panel.add(dropFirst);
-    
+
                 final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
                         @Override
@@ -275,5 +275,5 @@
                 final JDialog dlg = optionPane.createDialog(Main.parent, tr("Import path from GPX layer"));
                 dlg.setVisible(true);
-    
+
                 Object answer = optionPane.getValue();
                 if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE ||
@@ -281,8 +281,8 @@
                     return;
                 }
-    
-                GpxLayer gpx = (GpxLayer)layerList.getSelectedValue();
+
+                GpxLayer gpx = layerList.getSelectedValue();
                 if (dropFirst.isSelected()) {
-                    points = new ArrayList<WayPoint>(32);
+                    points = new ArrayList<>(32);
                 }
 
