Index: applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java
===================================================================
--- applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java	(revision 32491)
+++ applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java	(revision 32789)
@@ -1,11 +1,3 @@
-/*
- * This file is part of InfoMode plugin for JOSM.
- * http://wiki.openstreetmap.org/wiki/JOSM/Plugins/InfoMode
- *
- * Licence: GPL v2 or later
- * Author:  Alexei Kasatkin, 2011
- * Thanks to authors of BuildingTools, ImproveWayAccuracy
- * for good sample code
- */
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.infomode;
 
@@ -60,7 +52,7 @@
     InfoMode(MapFrame mapFrame) {
         super(tr("InfoMode"), "infomode.png", tr("GPX info mode"),
-		Shortcut.registerShortcut("mapmode:infomode", tr("Mode: {0}", tr("GPX info mode")), KeyEvent.VK_BACK_SLASH, Shortcut.DIRECT), mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-        infoPanel=new InfoPanel();
-
+                Shortcut.registerShortcut("mapmode:infomode", tr("Mode: {0}", tr("GPX info mode")), KeyEvent.VK_BACK_SLASH, Shortcut.DIRECT),
+                mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+        infoPanel = new InfoPanel();
     }
 
@@ -90,4 +82,5 @@
                     AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
+            Main.error(ex);
         }
     }
@@ -100,9 +93,10 @@
 
         Main.map.mapView.removeTemporaryLayer(this);
-        if (oldPopup!=null) oldPopup.hide();
+        if (oldPopup != null) oldPopup.hide();
 
         try {
             Toolkit.getDefaultToolkit().removeAWTEventListener(this);
         } catch (SecurityException ex) {
+            Main.error(ex);
         }
 
@@ -115,6 +109,4 @@
     }
 
-
-
     //////////    Event listener methods
 
@@ -122,5 +114,5 @@
     public void paint(Graphics2D g, MapView mv, Bounds bbox) {
         if (pos == null) return;
-        Layer curL= mv.getLayerManager().getActiveLayer();
+        Layer curL = mv.getLayerManager().getActiveLayer();
         if (curL instanceof GpxLayer) showLayerInfo(g, curL, mv); else {
             for (Layer l : mv.getLayerManager().getLayers()) {
@@ -155,7 +147,8 @@
         if (!isEnabled()) return;
         if (e.getButton() != MouseEvent.BUTTON1) return;
-        if (oldPopup!=null) {
+        if (oldPopup != null) {
             oldPopup.hide();
-            oldPopup=null;        wpOld=null;
+            oldPopup = null;
+            wpOld = null;
         }
         repaint();
@@ -164,7 +157,8 @@
     @Override
     public void mouseDragged(MouseEvent e) {
-        if (oldPopup!=null) {
+        if (oldPopup != null) {
             oldPopup.hide();
-            oldPopup=null;        wpOld=null;
+            oldPopup = null;
+            wpOld = null;
         }
     }
@@ -209,8 +203,6 @@
 // </editor-fold>
 
-
-
     private void repaint() {
-        if (Main.map!=null) Main.map.mapView.repaint();
+        if (Main.map != null) Main.map.mapView.repaint();
     }
     /*private void setStatusLine(String tr) {
@@ -222,12 +214,15 @@
         Layer l = getLayerManager().getActiveLayer();
 
-        if (l instanceof GpxLayer && pos!=null) {
-            GpxLayer gpxL = (GpxLayer )l;
+        if (l instanceof GpxLayer && pos != null) {
+            GpxLayer gpxL = (GpxLayer) l;
             Set<GpxTrack> toRemove = new HashSet<>();
             for (GpxTrack track : gpxL.data.tracks) {
-                boolean f=true;
+                boolean f = true;
                 sg: for (GpxTrackSegment seg : track.getSegments()) {
                     for (WayPoint S : seg.getWayPoints()) {
-                        if (S.time!=0) {f=false; break sg;}
+                        if (S.time != 0) {
+                            f = false;
+                            break sg;
+                        }
                     }
                 }
@@ -239,27 +234,27 @@
 
     private boolean showLayerInfo(Graphics2D g, Layer l, MapView mv) {
-            GpxLayer gpxL = (GpxLayer )l;
-
-            double minDist=1e9,d;
-            WayPoint wp=null,oldWp=null,prevWp=null;
-            GpxTrack trk=null;
+            GpxLayer gpxL = (GpxLayer) l;
+
+            double minDist = 1e9, d;
+            WayPoint wp = null, oldWp = null, prevWp = null;
+            GpxTrack trk = null;
             double maxD = mv.getDist100Pixel()/3;
             for (GpxTrack track : gpxL.data.tracks) {
                 for (GpxTrackSegment seg : track.getSegments()) {
-                    oldWp=null;// next segment will have new previous point
+                    oldWp = null; // next segment will have new previous point
                     for (WayPoint S : seg.getWayPoints()) {
                         d = S.getEastNorth().distance(pos);
 
-                        if (d<minDist && d<maxD) {
+                        if (d < minDist && d < maxD) {
                             minDist = d;
-                            prevWp=oldWp;
-                            wp=S;
-                            trk=track;
+                            prevWp = oldWp;
+                            wp = S;
+                            trk = track;
                             }
-                        oldWp=S;
+                        oldWp = S;
                     }
                 }
             }
-            if (wp!=null) {
+            if (wp != null) {
                 Point p = mv.getPoint(wp.getCoor());
 
@@ -267,12 +262,12 @@
                 g.fillOval(p.x-10, p.y-10, 20, 20); // mark selected point
                 if (shift) { // highlight track
-                    g.setColor(new Color(255,30,0,128));
+                    g.setColor(new Color(255, 30, 0, 128));
                     Stroke oldStroke = g.getStroke();
-                    g.setStroke( new BasicStroke(10) );
+                    g.setStroke(new BasicStroke(10));
                     for (GpxTrackSegment seg : trk.getSegments()) {
-                    Point oldP=null,curP=null;// next segment will have new previous point
+                    Point oldP = null, curP = null; // next segment will have new previous point
                         for (WayPoint S : seg.getWayPoints()) {
                             curP = mv.getPoint(S.getEastNorth());
-                            if (oldP!=null) g.drawLine(oldP.x, oldP.y, curP.x, curP.y);
+                            if (oldP != null) g.drawLine(oldP.x, oldP.y, curP.x, curP.y);
                             oldP = curP;
                         }
@@ -280,22 +275,23 @@
                     g.setStroke(oldStroke);
                 }
-                Point s=mv.getLocationOnScreen();
+                Point s = mv.getLocationOnScreen();
                 int pcx = s.x+p.x-40;
                 int pcy = s.y+p.y+30;
-                if (shift) {pcx+=40; pcy-=30;}
-
-                if (wp!=wpOld) {
-                    if (oldPopup!=null) oldPopup.hide();
-                    double vel=-1;
-                    if (prevWp!=null && wp.time!=prevWp.time) {
-                        vel=wp.getCoor().greatCircleDistance(prevWp.getCoor())/
+                if (shift) {
+                    pcx += 40;
+                    pcy -= 30;
+                }
+                if (wp != wpOld) {
+                    if (oldPopup != null) oldPopup.hide();
+                    double vel = -1;
+                    if (prevWp != null && wp.time != prevWp.time) {
+                        vel = wp.getCoor().greatCircleDistance(prevWp.getCoor())/
                                 (wp.time-prevWp.time)*3.6;
                     }
-                    infoPanel.setData(wp,trk,vel,gpxL.data.tracks);
-                    Popup pp=PopupFactory.getSharedInstance().getPopup(mv, infoPanel,
-                            pcx, pcy);
+                    infoPanel.setData(wp, trk, vel, gpxL.data.tracks);
+                    Popup pp = PopupFactory.getSharedInstance().getPopup(mv, infoPanel, pcx, pcy);
                     pp.show();
-                    wpOld=wp;
-                    oldPopup=pp;
+                    wpOld = wp;
+                    oldPopup = pp;
                 }
                 return true;
Index: applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoModePlugin.java
===================================================================
--- applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoModePlugin.java	(revision 32491)
+++ applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoModePlugin.java	(revision 32789)
@@ -1,12 +1,5 @@
-/*
- * This file is part of InfoMode plugin for JOSM.
- * http://wiki.openstreetmap.org/wiki/JOSM/Plugins/InfoMode
- *
- * Licence: GPL v2 or later
- * Author:  Alexei Kasatkin, 2011
- * Ideas by siberiano, Ilis, chnav, Polarbear-j, 
- */
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.infomode;
 
-package org.openstreetmap.josm.plugins.infomode;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.IconToggleButton;
@@ -14,4 +7,5 @@
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
+
 public class InfoModePlugin extends Plugin {
 
@@ -24,5 +18,5 @@
         if (oldFrame == null && newFrame != null) {
             Main.map.addMapMode(new IconToggleButton(new InfoMode(Main.map)));
-        }        
+        }
     }
 }
Index: applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoPanel.java
===================================================================
--- applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoPanel.java	(revision 32491)
+++ applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoPanel.java	(revision 32789)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.infomode;
 
@@ -32,25 +33,25 @@
     private DateFormat df;
 
-    private JLabel label1=new JLabel();
-    private JLabel label2=new JLabel();
-    private JLabel label3=new JLabel();
-    private JLabel label4=new JLabel();
-    private JLabel label5=new JLabel();
-    private JLabel label6=new JLabel();
+    private JLabel label1 = new JLabel();
+    private JLabel label2 = new JLabel();
+    private JLabel label3 = new JLabel();
+    private JLabel label4 = new JLabel();
+    private JLabel label5 = new JLabel();
+    private JLabel label6 = new JLabel();
     private JButton but1 = new JButton(tr("Delete this"));
     private JButton but2 = new JButton(tr("Delete this&older"));
 
-    public InfoPanel() {
+    InfoPanel() {
         super(new GridBagLayout());
-        df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT,DateFormat.DEFAULT, Locale.getDefault());
-        setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-        add(label1, GBC.eol().insets(10,0,0,0));
-        add(label2, GBC.eol().insets(10,0,0,0));
-        add(label3, GBC.eol().insets(10,0,0,0));
-        add(label4, GBC.eol().insets(10,0,0,0));
-        add(label5, GBC.eol().insets(10,0,0,0));
-        add(label6, GBC.eol().insets(10,0,0,0));
-        add(but1, GBC.std().insets(10,5,0,0));
-        add(but2, GBC.eop().insets(10,5,0,0));
+        df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.getDefault());
+        setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+        add(label1, GBC.eol().insets(10, 0, 0, 0));
+        add(label2, GBC.eol().insets(10, 0, 0, 0));
+        add(label3, GBC.eol().insets(10, 0, 0, 0));
+        add(label4, GBC.eol().insets(10, 0, 0, 0));
+        add(label5, GBC.eol().insets(10, 0, 0, 0));
+        add(label6, GBC.eol().insets(10, 0, 0, 0));
+        add(but1, GBC.std().insets(10, 5, 0, 0));
+        add(but2, GBC.eop().insets(10, 5, 0, 0));
         // lightweight hyperlink
         label6.addMouseListener(new MouseListener() {
@@ -58,19 +59,23 @@
             public void mouseClicked(MouseEvent e) {
                 String s = label6.getText();
-                OpenBrowser.displayUrl( s.substring(9, s.length()-11) );
+                OpenBrowser.displayUrl(s.substring(9, s.length()-11));
             }
+
             @Override
-			public void mousePressed(MouseEvent e) { }
+            public void mousePressed(MouseEvent e) { }
+
             @Override
-			public void mouseReleased(MouseEvent e) { }
+            public void mouseReleased(MouseEvent e) { }
+
             @Override
-			public void mouseEntered(MouseEvent e) { }
+            public void mouseEntered(MouseEvent e) { }
+
             @Override
-			public void mouseExited(MouseEvent e) { }
+            public void mouseExited(MouseEvent e) { }
         });
         but1.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
-                if (tracks!=null) tracks.remove(trk);
+                if (tracks != null) tracks.remove(trk);
                 Main.map.mapView.repaint();
             }
@@ -79,19 +84,24 @@
             @Override
             public void actionPerformed(ActionEvent e) {
-            if (tracks==null) return;
+            if (tracks == null) return;
             Set<GpxTrack> toRemove = new HashSet<>();
 
-            double tm=-1;
+            double tm = -1;
             for (GpxTrackSegment seg : trk.getSegments()) {
                     for (WayPoint S : seg.getWayPoints()) {
-                        if (S.time>tm) {tm=S.time;}
+                        if (S.time > tm) {
+                            tm = S.time;
+                        }
                     }
                 }
 
             for (GpxTrack track : tracks) {
-                boolean f=true;
+                boolean f = true;
                 sg: for (GpxTrackSegment seg : track.getSegments()) {
                     for (WayPoint S : seg.getWayPoints()) {
-                        if (S.time>tm) {f=false; break sg;}
+                        if (S.time > tm) {
+                            f = false;
+                            break sg;
+                        }
                     }
                 }
@@ -107,7 +117,8 @@
 
     void setData(WayPoint wp, GpxTrack trk, double vel, Collection<GpxTrack> tracks) {
-        this.tracks=tracks;
-        this.trk=trk;
-        if (wp.time==0.0) { label1.setText(tr("No timestamp"));
+        this.tracks = tracks;
+        this.trk = trk;
+        if (wp.time == 0.0) {
+            label1.setText(tr("No timestamp"));
             but2.setVisible(false);
         } else {
@@ -115,15 +126,20 @@
             but2.setVisible(true);
         }
-        if (vel>0) label2.setText(String.format("%.1f "+tr("km/h"), vel));
-              else label2.setText(null);
+        if (vel > 0) label2.setText(String.format("%.1f "+tr("km/h"), vel));
+        else label2.setText(null);
         String s = (String) trk.getAttributes().get("name");
-        if (s!=null) label3.setText(tr("Track name: ")+s);
-                else label3.setText(null);
+        if (s != null)
+            label3.setText(tr("Track name: ")+s);
+        else label3.setText(null);
         s = (String) trk.getAttributes().get("desc");
         label4.setText(s);
         s = (String) wp.attr.get("ele");
-        String s1="";
-        try {s1 = String.format("H=%3.1f   ", Double.parseDouble(s));} catch (Exception e) { }
-        s1=s1+"L="+(int)trk.length();
+        String s1 = "";
+        try {
+            s1 = String.format("H=%3.1f   ", Double.parseDouble(s));
+        } catch (Exception e) {
+            Main.warn(e);
+        }
+        s1 = s1+"L="+(int) trk.length();
         label5.setText(s1);
         if (trk.getAttributes().containsKey("url")) {
