Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 15497)
@@ -132,5 +132,5 @@
 
     /** rename keys that equal */
-    private final static Map<String, String> UPDATE_PREF_KEYS = getUpdatePrefKeys();
+    private static final Map<String, String> UPDATE_PREF_KEYS = getUpdatePrefKeys();
 
     private static Map<String, String> getUpdatePrefKeys() {
Index: /trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 15497)
@@ -1208,7 +1208,7 @@
          * Creates a schema with prefix, URI and location.
          * Does NOT try to determine prefix from URI!
-         * @param prefix
-         * @param uri
-         * @param location
+         * @param prefix XML namespace prefix
+         * @param uri XML namespace URI
+         * @param location XML namespace location
          */
         public XMLNamespace(String prefix, String uri, String location) {
Index: /trunk/src/org/openstreetmap/josm/data/gpx/GpxExtension.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/GpxExtension.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/GpxExtension.java	(revision 15497)
@@ -12,5 +12,5 @@
  * @since 15496
  */
-public class GpxExtension extends WithAttributes implements IWithAttributes, GpxConstants {
+public class GpxExtension extends WithAttributes implements GpxConstants {
     private final String qualifiedName, prefix, key;
     private IWithAttributes parent;
@@ -60,5 +60,5 @@
     /**
      * Finds the default prefix used by JOSM for the given namespaceURI as the document is free specify another one.
-     * @param namespaceURI
+     * @param namespaceURI namespace URI
      * @return the prefix
      */
Index: /trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java	(revision 15497)
@@ -20,4 +20,6 @@
  */
 public class GpxExtensionCollection extends ArrayList<GpxExtension> {
+
+    private static final long serialVersionUID = 1L;
 
     private Stack<GpxExtension> childStack = new Stack<>();
Index: /trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java	(revision 15497)
@@ -95,7 +95,7 @@
 
     private void setColorExtension(Color color) {
-        getExtensions().findAndRemove("gpxx",  "DisplayColor");
+        getExtensions().findAndRemove("gpxx", "DisplayColor");
         if (color == null) {
-            getExtensions().findAndRemove("gpxd",  "color");
+            getExtensions().findAndRemove("gpxd", "color");
         } else {
             getExtensions().addOrUpdate("gpxd", "color", String.format("#%02X%02X%02X", color.getRed(), color.getGreen(), color.getBlue()));
Index: /trunk/src/org/openstreetmap/josm/data/gpx/IGpxTrack.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/gpx/IGpxTrack.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/data/gpx/IGpxTrack.java	(revision 15497)
@@ -42,5 +42,5 @@
     /**
      * Sets the color of this track. Not necessarily supported by all implementations.
-     * @param color
+     * @param color color of this track
      * @since 15496
      */
Index: /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 15497)
@@ -175,5 +175,5 @@
      * Will not be saved to .osm files, but that's not necessary because GPX files won't automatically be overridden after that.
      */
-    private List<XMLNamespace> GPXNamespaces;
+    private List<XMLNamespace> gpxNamespaces;
 
     /**
@@ -1206,13 +1206,13 @@
      */
     public List<XMLNamespace> getGPXNamespaces() {
-        return GPXNamespaces;
+        return gpxNamespaces;
     }
 
     /**
      * Sets the GPX (XML) namespaces
-     * @param GPXNamespaces the GPXNamespaces to set
-     */
-    public void setGPXNamespaces(List<XMLNamespace> GPXNamespaces) {
-        this.GPXNamespaces = GPXNamespaces;
+     * @param gpxNamespaces the GPXNamespaces to set
+     */
+    public void setGPXNamespaces(List<XMLNamespace> gpxNamespaces) {
+        this.gpxNamespaces = gpxNamespaces;
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java	(revision 15497)
@@ -195,13 +195,14 @@
 
         garmin.addActionListener(l -> {
-            if (garmin.isSelected() &&
-                    !ConditionalOptionPaneUtil.showConfirmationDialog(
-                            "gpx_color_garmin",
-                            ed,
-                            new JLabel(tr("<html>Garmin track extensions only support 16 colors.<br>If you continue, the closest supported track color will be used.</html>")),
-                            tr("Information"),
-                            JOptionPane.OK_CANCEL_OPTION,
-                            JOptionPane.INFORMATION_MESSAGE,
-                            JOptionPane.OK_OPTION)) {
+            if (garmin.isSelected() && !ConditionalOptionPaneUtil.showConfirmationDialog(
+                    "gpx_color_garmin",
+                    ed,
+                    new JLabel("<html>" + tr("Garmin track extensions only support 16 colors.") + "<br>"
+                                        + tr("If you continue, the closest supported track color will be used.")
+                             + "</html>"),
+                    tr("Information"),
+                    JOptionPane.OK_CANCEL_OPTION,
+                    JOptionPane.INFORMATION_MESSAGE,
+                    JOptionPane.OK_OPTION)) {
                 garmin.setSelected(false);
             }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 15497)
@@ -306,5 +306,6 @@
         if (Logging.isDebugEnabled() && !data.getLayerPrefs().isEmpty()) {
             info.append("<br><br>")
-                .append(String.join("<br>", data.getLayerPrefs().entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.toList())));
+                .append(String.join("<br>", data.getLayerPrefs().entrySet().stream()
+                        .map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.toList())));
         }
 
Index: /trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertFromGpxLayerAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertFromGpxLayerAction.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertFromGpxLayerAction.java	(revision 15497)
@@ -149,5 +149,6 @@
                     pre = "other";
                 }
-                String segpre = seg ? "segment:" : ""; //needs to be distinguished since both track and segment extensions are applied to the resulting way
+                // needs to be distinguished since both track and segment extensions are applied to the resulting way
+                String segpre = seg ? "segment:" : "";
                 String key = ext.getFlatKey();
                 String fullkey = GpxConstants.GPX_PREFIX + extpre + pre + ":" + segpre + key;
Index: /trunk/src/org/openstreetmap/josm/gui/layer/gpx/CustomizeDrawingAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/gpx/CustomizeDrawingAction.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/gpx/CustomizeDrawingAction.java	(revision 15497)
@@ -76,5 +76,6 @@
     @Override
     public void actionPerformed(ActionEvent e) {
-        GPXSettingsPanel panel = new GPXSettingsPanel(layers.stream().filter(l -> l instanceof GpxLayer).map(l -> (GpxLayer) l).collect(Collectors.toList()));
+        GPXSettingsPanel panel = new GPXSettingsPanel(
+                layers.stream().filter(l -> l instanceof GpxLayer).map(l -> (GpxLayer) l).collect(Collectors.toList()));
         JScrollPane scrollpane = GuiHelper.embedInVerticalScrollPane(panel);
         scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
Index: /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ButtonMarker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ButtonMarker.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ButtonMarker.java	(revision 15497)
@@ -65,5 +65,5 @@
 
         String labelText = getText();
-        if (labelText != null && Config.getPref().getBoolean("marker.buttonlabels", true)) {
+        if (!labelText.isEmpty() && Config.getPref().getBoolean("marker.buttonlabels", true)) {
             g.drawString(labelText, screen.x+4, screen.y+2);
         }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java	(revision 15497)
@@ -279,5 +279,5 @@
 
         String labelText = getText();
-        if ((labelText != null) && showTextOrIcon) {
+        if (!labelText.isEmpty() && showTextOrIcon) {
             g.drawString(labelText, screen.x+4, screen.y+2);
         }
@@ -321,5 +321,5 @@
     private String getDefaultTextTemplate() {
         if (cachedDefaultTemplate == null) {
-            cachedDefaultTemplate = GPXSettingsPanel.getLayerPref(null,  getTextTemplateKey());
+            cachedDefaultTemplate = GPXSettingsPanel.getLayerPref(null, getTextTemplateKey());
         }
         return cachedDefaultTemplate;
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 15497)
@@ -104,5 +104,5 @@
     private final boolean hasNonLocalFile; // flag to display AllLines checkbox
 
-    private final static Map<String, Object> DEFAULT_PREFS = getDefaultPrefs();
+    private static final Map<String, Object> DEFAULT_PREFS = getDefaultPrefs();
 
     private static Map<String, Object> getDefaultPrefs() {
@@ -263,5 +263,6 @@
      */
     public static void putLayerPrefLocal(GpxData data, String key, String value) {
-        if (value == null || value.trim().isEmpty() || (getLayerPref(null, key).equals(value) && DEFAULT_PREFS.get(key) != null && DEFAULT_PREFS.get(key).toString().equals(value))) {
+        if (value == null || value.trim().isEmpty() ||
+                (getLayerPref(null, key).equals(value) && DEFAULT_PREFS.get(key) != null && DEFAULT_PREFS.get(key).toString().equals(value))) {
             data.getLayerPrefs().remove(key);
         } else {
Index: /trunk/src/org/openstreetmap/josm/gui/util/StayOpenPopupMenu.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/util/StayOpenPopupMenu.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/gui/util/StayOpenPopupMenu.java	(revision 15497)
@@ -53,10 +53,10 @@
         if (PlatformManager.isPlatformOsx()) {
             try {
-                Class<?> AppContextClass = Class.forName("sun.awt.AppContext");
-                Field tableField = AppContextClass.getDeclaredField("table");
+                Class<?> appContextClass = Class.forName("sun.awt.AppContext");
+                Field tableField = appContextClass.getDeclaredField("table");
                 ReflectionUtils.setObjectsAccessible(tableField);
                 Object mouseGrabber = null;
                 for (Entry<?, ?> e : ((Map<?, ?>)
-                        tableField.get(AppContextClass.getMethod("getAppContext").invoke(AppContextClass))).entrySet()) {
+                        tableField.get(appContextClass.getMethod("getAppContext").invoke(appContextClass))).entrySet()) {
                     if (MOUSE_GRABBER_KEY.equals(Objects.toString(e.getKey()))) {
                         mouseGrabber = e.getValue();
Index: /trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 15497)
@@ -264,4 +264,5 @@
                     currentState = State.EXT;
                     break;
+                default: // Do nothing
                 }
                 break;
Index: /trunk/src/org/openstreetmap/josm/io/GpxWriter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 15496)
+++ /trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 15497)
@@ -128,5 +128,5 @@
         out.println("<gpx version=\"1.1\" creator=\"JOSM GPX export\" xmlns=\"http://www.topografix.com/GPX/1/1\"");
 
-        String schemaLocations = "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd";
+        StringBuilder schemaLocations = new StringBuilder("http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");
 
         for (XMLNamespace n : namespaces) {
@@ -134,5 +134,5 @@
                 out.println(String.format("    xmlns:%s=\"%s\"", n.getPrefix(), n.getURI()));
                 if (n.getLocation() != null) {
-                    schemaLocations += " " + n.getURI() + " " + n.getLocation();
+                    schemaLocations.append(' ').append(n.getURI()).append(' ').append(n.getLocation());
                 }
             }
@@ -394,5 +394,6 @@
                 // but otherwise the file is invalid and can't even be parsed by SAX anymore
                 String k = (e.getPrefix().isEmpty() ? "" : e.getPrefix() + ":") + e.getKey();
-                String attr = String.join(" ", e.getAttributes().entrySet().stream().map(a -> encode(a.getKey()) + "=\"" + encode(a.getValue().toString()) + "\"").sorted().collect(Collectors.toList()));
+                String attr = String.join(" ", e.getAttributes().entrySet().stream()
+                        .map(a -> encode(a.getKey()) + "=\"" + encode(a.getValue().toString()) + "\"").sorted().collect(Collectors.toList()));
                 if (e.getValue() == null && e.getExtensions().isEmpty()) {
                     inline(k, attr);
Index: /trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 15496)
+++ /trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 15497)
@@ -480,5 +480,6 @@
         EqualsVerifier.forClass(GpxData.class).usingGetClass()
             .suppress(Warning.NONFINAL_FIELDS)
-            .withIgnoredFields("creator", "fromServer", "storageFile", "initializing", "updating", "suppressedInvalidate", "listeners", "tracks", "routes", "waypoints", "proxy", "segSpans", "modified")
+            .withIgnoredFields("creator", "fromServer", "storageFile", "initializing", "updating",
+                    "suppressedInvalidate", "listeners", "tracks", "routes", "waypoints", "proxy", "segSpans", "modified")
             .withPrefabValues(WayPoint.class, new WayPoint(LatLon.NORTH_POLE), new WayPoint(LatLon.SOUTH_POLE))
             .withPrefabValues(ListenerList.class, ListenerList.create(), ListenerList.create())
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 15496)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 15497)
@@ -45,5 +45,6 @@
                 "<html>Select all tracks that you want to be displayed. " +
                         "You can drag select a range of tracks or use CTRL+Click to select specific ones. " +
-                        "The map is updated live in the background. Open the URLs by double clicking them, edit name and description by double clicking the cell.</html>",
+                        "The map is updated live in the background. "+
+                        "Open the URLs by double clicking them, edit name and description by double clicking the cell.</html>",
                         "Show all"
                 );
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java	(revision 15496)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java	(revision 15497)
@@ -141,10 +141,12 @@
 
         List<String> ways = osm.getWays().stream()
-                .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream().sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
+                .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream()
+                        .sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
                 .sorted()
                 .collect(Collectors.toList());
 
         List<String> waysExpected = osmExpected.getWays().stream()
-                .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream().sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
+                .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream()
+                        .sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
                 .sorted()
                 .collect(Collectors.toList());
@@ -152,5 +154,6 @@
         assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", waysExpected, ways);
 
-        assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", osmExpected.allPrimitives().size(), osm.allPrimitives().size());
+        assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", osmExpected.allPrimitives().size(),
+                osm.allPrimitives().size());
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java	(revision 15496)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java	(revision 15497)
@@ -72,5 +72,6 @@
     @Test
     public void testVelocity() throws IOException, SAXException {
-        final List<String> colors = calculateColors("data_nodist/2094047.gpx", ImmutableMap.of("colormode", Integer.toString(ColorMode.VELOCITY.toIndex())), 10);
+        final List<String> colors = calculateColors("data_nodist/2094047.gpx",
+                ImmutableMap.of("colormode", Integer.toString(ColorMode.VELOCITY.toIndex())), 10);
         assertEquals("[#000000, #FFAD00, #FFA800, #FFA800, #FF9E00, #FF9400, #FF7000, #FF7000, #FF8000, #FF9400]", colors.toString());
     }
@@ -99,5 +100,6 @@
     @Test
     public void testDirection() throws IOException, SAXException {
-        final List<String> colors = calculateColors("data_nodist/2094047.gpx", ImmutableMap.of("colormode", Integer.toString(ColorMode.DIRECTION.toIndex())), 10);
+        final List<String> colors = calculateColors("data_nodist/2094047.gpx",
+                ImmutableMap.of("colormode", Integer.toString(ColorMode.DIRECTION.toIndex())), 10);
         assertEquals("[#000000, #EAEC25, #EDEA26, #EDE525, #ECD322, #EBB81D, #E85A0D, #E73708, #E84D0B, #EA8A15]", colors.toString());
     }
@@ -111,5 +113,6 @@
     @Test
     public void testTime() throws IOException, SAXException {
-        final List<String> colors = calculateColors("data_nodist/2094047.gpx", ImmutableMap.of("colormode", Integer.toString(ColorMode.TIME.toIndex())), 10);
+        final List<String> colors = calculateColors("data_nodist/2094047.gpx",
+                ImmutableMap.of("colormode", Integer.toString(ColorMode.TIME.toIndex())), 10);
         assertEquals("[#000000, #FF0000, #FF0000, #FF0500, #FF0500, #FF0A00, #FF0A00, #FF1F00, #FF2E00, #FF3300]", colors.toString());
     }
Index: /trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java	(revision 15496)
+++ /trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java	(revision 15497)
@@ -103,7 +103,10 @@
     public void testExtensions() throws IOException {
         GpxData data = new GpxData();
-        data.getNamespaces().add(new XMLNamespace("test", "http://example.com/testURI")); //only namespace, no location printed
-        data.getNamespaces().add(new XMLNamespace("knownprefix", "http://example.com/URI", "http://example.com/location.xsd")); //printed
-        data.getNamespaces().add(new XMLNamespace("notpresent", "http://example.com/notpresent", "http://example.com/notpresent.xsd")); //NOT printed
+        // only namespace, no location printed
+        data.getNamespaces().add(new XMLNamespace("test", "http://example.com/testURI"));
+        // printed
+        data.getNamespaces().add(new XMLNamespace("knownprefix", "http://example.com/URI", "http://example.com/location.xsd"));
+        // NOT printed
+        data.getNamespaces().add(new XMLNamespace("notpresent", "http://example.com/notpresent", "http://example.com/notpresent.xsd"));
 
         GpxExtensionCollection exts = data.getExtensions();
@@ -128,4 +131,6 @@
         GpxWriter writer = new GpxWriter(baos);
 
+        // CHECKSTYLE.OFF: LineLength
+
         writer.write(data);
         assertEquals("<?xml version='1.0' encoding='UTF-8'?>\n" +
@@ -275,4 +280,6 @@
                 "</gpx>", baos.toString());
 
+        // CHECKSTYLE.ON: LineLength
+
         writer.close();
     }
