Index: applications/editors/josm/plugins/globalsat/.checkstyle
===================================================================
--- applications/editors/josm/plugins/globalsat/.checkstyle	(revision 32649)
+++ applications/editors/josm/plugins/globalsat/.checkstyle	(revision 32649)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <local-check-config name="JOSM" location="/JOSM/tools/checkstyle/josm_checks.xml" type="project" description="">
+    <additional-data name="protect-config-file" value="false"/>
+  </local-check-config>
+  <fileset name="all" enabled="true" check-config-name="JOSM" local="true">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+  <filter name="DerivedFiles" enabled="true"/>
+  <filter name="FilesFromPackage" enabled="true">
+    <filter-data value="src/org/kaintoch"/>
+    <filter-data value="data"/>
+    <filter-data value="images"/>
+    <filter-data value="styles"/>
+    <filter-data value="resources"/>
+    <filter-data value="scripts"/>
+  </filter>
+</fileset-config>
Index: applications/editors/josm/plugins/globalsat/.project
===================================================================
--- applications/editors/josm/plugins/globalsat/.project	(revision 32648)
+++ applications/editors/josm/plugins/globalsat/.project	(revision 32649)
@@ -16,7 +16,13 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 	</natures>
 </projectDescription>
Index: applications/editors/josm/plugins/globalsat/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/globalsat/.settings/org.eclipse.jdt.ui.prefs	(revision 32649)
+++ applications/editors/josm/plugins/globalsat/.settings/org.eclipse.jdt.ui.prefs	(revision 32649)
@@ -0,0 +1,60 @@
+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
+sp_cleanup.use_type_arguments=false
Index: applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java
===================================================================
--- applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java	(revision 32648)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java	(revision 32649)
@@ -1,3 +1,3 @@
-// License: GPL v2 or later (v3 preferred). Copyright 2008 by Raphael Mack
+// License: GPL. For details, see LICENSE file.
 
 //TODO: check input for numbers in text fields
@@ -28,18 +28,17 @@
  * Configuration download dialog.
  *
- * @author Raphael Mack <ramack@raphael-mack.de>
- *
+ * @author Raphael Mack &lt;ramack@raphael-mack.de&gt;
  */
 public class GlobalsatConfigDialog extends JPanel {
 
-
     public class IntegerTextField extends JTextField {
 
-        final static String badchars = "-`~!@#$%^&*()_+=\\|\"':;?/>.<, ";
-
+        static final String badchars = "-`~!@#$%^&*()_+=\\|\"':;?/>.<, ";
+
+        @Override
         public void processKeyEvent(KeyEvent ev) {
 
             char c = ev.getKeyChar();
-            if((Character.isLetter(c) && !ev.isAltDown())
+            if ((Character.isLetter(c) && !ev.isAltDown())
                || badchars.indexOf(c) > -1) {
                 ev.consume();
@@ -79,15 +78,15 @@
 
         Dimension xx = aSeconds.getPreferredSize();
-        aSeconds.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        aSeconds.setPreferredSize(new Dimension((int) xx.getWidth() + 50, (int) xx.getHeight()));
         aSeconds.setHorizontalAlignment(JTextField.RIGHT);
-        aMeters.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        aMeters.setPreferredSize(new Dimension((int) xx.getWidth() + 50, (int) xx.getHeight()));
         aMeters.setHorizontalAlignment(JTextField.RIGHT);
-        bSeconds.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        bSeconds.setPreferredSize(new Dimension((int) xx.getWidth() + 50, (int) xx.getHeight()));
         bSeconds.setHorizontalAlignment(JTextField.RIGHT);
-        bMeters.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        bMeters.setPreferredSize(new Dimension((int) xx.getWidth() + 50, (int) xx.getHeight()));
         bMeters.setHorizontalAlignment(JTextField.RIGHT);
-        cSeconds.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        cSeconds.setPreferredSize(new Dimension((int) xx.getWidth() + 50, (int) xx.getHeight()));
         cSeconds.setHorizontalAlignment(JTextField.RIGHT);
-        cMeters.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        cMeters.setPreferredSize(new Dimension((int) xx.getWidth() + 50, (int) xx.getHeight()));
         cMeters.setHorizontalAlignment(JTextField.RIGHT);
 
@@ -106,5 +105,5 @@
         logPanel.add(formatPosTDSA);
 
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1.8;
@@ -116,5 +115,5 @@
 
         disableLogSpeed = new JCheckBox(tr("Disable data logging if speed falls below"));
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 0.8;
@@ -127,5 +126,5 @@
         minLogSpeed = new IntegerTextField();
         minLogSpeed.setHorizontalAlignment(JTextField.RIGHT);
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1.5;
@@ -135,6 +134,7 @@
         add(minLogSpeed, c);
 
-        disableLogSpeed.addActionListener(new ActionListener(){
-                public void actionPerformed(java.awt.event.ActionEvent e){
+        disableLogSpeed.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(java.awt.event.ActionEvent e) {
                     minLogSpeed.setEnabled(disableLogSpeed.isSelected());
                 }
@@ -142,5 +142,5 @@
 
         disableLogDist = new JCheckBox(tr("Disable data logging if distance falls below"));
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridwidth = 1;
         c.weightx = 0.8;
@@ -152,5 +152,5 @@
         minLogDist = new IntegerTextField();
         minLogDist.setHorizontalAlignment(JTextField.RIGHT);
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridwidth = 1;
         c.weightx = 1.5;
@@ -160,8 +160,9 @@
         add(minLogDist, c);
         Dimension x = minLogDist.getPreferredSize();
-        minLogDist.setPreferredSize(new Dimension((int)x.getWidth() + 50, (int)x.getHeight()));
-
-        disableLogDist.addActionListener(new ActionListener(){
-                public void actionPerformed(java.awt.event.ActionEvent e){
+        minLogDist.setPreferredSize(new Dimension((int) x.getWidth() + 50, (int) x.getHeight()));
+
+        disableLogDist.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(java.awt.event.ActionEvent e) {
                     minLogDist.setEnabled(disableLogDist.isSelected());
                 }
@@ -180,5 +181,5 @@
         group.add(aDist);
 
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1;
@@ -187,9 +188,9 @@
         c.gridy = 3;
         add(aTime, c);
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridy = 4;
         add(aDist, c);
 
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1;
@@ -198,5 +199,5 @@
         c.gridy = 3;
         add(aSeconds, c);
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridy = 4;
         add(aMeters, c);
@@ -206,5 +207,5 @@
         group.add(bDist);
 
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1;
@@ -213,9 +214,9 @@
         c.gridy = 5;
         add(bTime, c);
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridy = 6;
         add(bDist, c);
 
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1;
@@ -224,5 +225,5 @@
         c.gridy = 5;
         add(bSeconds, c);
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridy = 6;
         add(bMeters, c);
@@ -232,5 +233,5 @@
         group.add(cDist);
 
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1;
@@ -239,9 +240,9 @@
         c.gridy = 7;
         add(cTime, c);
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridy = 8;
         add(cDist, c);
 
-        c.insets = new Insets(4,4,0,4);
+        c.insets = new Insets(4, 4, 0, 4);
         c.gridwidth = 1;
         c.weightx = 1;
@@ -250,5 +251,5 @@
         c.gridy = 7;
         add(cSeconds, c);
-        c.insets = new Insets(0,4,4,4);
+        c.insets = new Insets(0, 4, 4, 4);
         c.gridy = 8;
         add(cMeters, c);
@@ -258,7 +259,5 @@
         //add ID textbox
 
-
-
-        switch(conf.getLogFormat()){
+        switch(conf.getLogFormat()) {
         case 0:
             formatPosOnly.setSelected(true);
@@ -274,24 +273,24 @@
         }
 
-        if(conf.getSwATimeOrDist() == 0){
+        if (conf.getSwATimeOrDist() == 0) {
             aTime.setSelected(true);
             aDist.setSelected(false);
-        }else{
+        } else {
             aTime.setSelected(false);
             aDist.setSelected(true);
         }
 
-        if(conf.getSwBTimeOrDist() == 0){
+        if (conf.getSwBTimeOrDist() == 0) {
             bTime.setSelected(true);
             bDist.setSelected(false);
-        }else{
+        } else {
             bTime.setSelected(false);
             bDist.setSelected(true);
         }
 
-        if(conf.getSwCTimeOrDist() == 0){
+        if (conf.getSwCTimeOrDist() == 0) {
             cTime.setSelected(true);
             cDist.setSelected(false);
-        }else{
+        } else {
             cTime.setSelected(false);
             cDist.setSelected(true);
@@ -306,5 +305,4 @@
         cSeconds.setText("" + conf.getSwCTime() / 1000);
         cMeters.setText("" + conf.getSwCDist());
-
     }
 
@@ -312,5 +310,5 @@
      * Get the selected configuration.
      */
-    public Dg100Config getConfig(){
+    public Dg100Config getConfig() {
         conf.setDisableLogDist(disableLogDist.isSelected());
         conf.setDisableLogSpeed(disableLogSpeed.isSelected());
@@ -318,15 +316,15 @@
         conf.setSpeedThres(Integer.parseInt(minLogSpeed.getText()));
 
-        if(formatPosOnly.isSelected()){
-            conf.setLogFormat((byte)0);
-        }else if(formatPosTDS.isSelected()){
-            conf.setLogFormat((byte)1);
-        }else if(formatPosTDSA.isSelected()){
-            conf.setLogFormat((byte)2);
-        }
-
-        conf.setSwATimeOrDist((byte)(aDist.isSelected() ? 1 : 0));
-        conf.setSwBTimeOrDist((byte)(bDist.isSelected() ? 1 : 0));
-        conf.setSwCTimeOrDist((byte)(cDist.isSelected() ? 1 : 0));
+        if (formatPosOnly.isSelected()) {
+            conf.setLogFormat((byte) 0);
+        } else if (formatPosTDS.isSelected()) {
+            conf.setLogFormat((byte) 1);
+        } else if (formatPosTDSA.isSelected()) {
+            conf.setLogFormat((byte) 2);
+        }
+
+        conf.setSwATimeOrDist((byte) (aDist.isSelected() ? 1 : 0));
+        conf.setSwBTimeOrDist((byte) (bDist.isSelected() ? 1 : 0));
+        conf.setSwCTimeOrDist((byte) (cDist.isSelected() ? 1 : 0));
 
         conf.setSwATime(Integer.parseInt(aSeconds.getText()) * 1000);
Index: applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java
===================================================================
--- applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java	(revision 32648)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java	(revision 32649)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 /**
  * Communicate with a GlobalSat DG-100 GPS mouse and data logger.
@@ -5,9 +6,4 @@
  */
 package org.openstreetmap.josm.plugins.globalsat;
-
-import gnu.io.CommPortIdentifier;
-import gnu.io.PortInUseException;
-import gnu.io.SerialPort;
-import gnu.io.UnsupportedCommOperationException;
 
 import java.io.IOException;
@@ -31,15 +27,21 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 
+import gnu.io.CommPortIdentifier;
+import gnu.io.PortInUseException;
+import gnu.io.SerialPort;
+import gnu.io.UnsupportedCommOperationException;
+
 /**
  * @author ramack
  *
  */
-public class GlobalsatDg100
-{
-    public class ConnectionException extends Exception{
-        ConnectionException(Exception cause){
+public class GlobalsatDg100 {
+
+    public class ConnectionException extends Exception {
+        ConnectionException(Exception cause) {
             super(cause);
         }
-        ConnectionException(String msg){
+
+        ConnectionException(String msg) {
             super(msg);
         }
@@ -65,41 +67,41 @@
     };*/
     /** delete file: A0 A2 00 03 BA FF FF 02 B8 B0 B3 */
-    private static byte dg100CmdDelFile[] =
-    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBA
-      , (byte) 0xFF, (byte) 0xFF, (byte) 0x02, (byte) 0xB8, (byte) 0xB0, (byte) 0xB3
+    private static byte[] dg100CmdDelFile =
+    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBA,
+     (byte) 0xFF, (byte) 0xFF, (byte) 0x02, (byte) 0xB8, (byte) 0xB0, (byte) 0xB3
     };
     /** get file info: A0 A2 00 03 BB 00 00 00 BB B0 B3 */
-    private static byte dg100CmdGetFileInfo[] =
-    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBB
-      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xBB, (byte) 0xB0, (byte) 0xB3
+    private static byte[] dg100CmdGetFileInfo =
+    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xBB,
+     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xBB, (byte) 0xB0, (byte) 0xB3
     };
     /** get gps recs: A0 A2 00 03 B5 00 02 00 B7 B0 B3 */
-    private static byte dg100CmdGetGpsRecs[] =
-    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xB5
-      , (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3
+    private static byte[] dg100CmdGetGpsRecs =
+    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x03, (byte) 0xB5,
+     (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3
     };
     /** read config: A0 A2 00 01 B7 00 B7 B0 B3 */
-    private static byte dg100CmdGetConfig[] =
-    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x01, (byte) 0xB7
-      , (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3 };
+    private static byte[] dg100CmdGetConfig =
+    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x01, (byte) 0xB7,
+     (byte) 0x00, (byte) 0xB7, (byte) 0xB0, (byte) 0xB3 };
     /** set config: A0 A2 00 2A B8 jj kk ll ll ll ll mm nn nn nn nn
         aa aa aa aa bb bb bb bb cc cc cc cc 00 00 gg hh
         ii dd dd dd dd ee ee ee ee ff ff ff ff 01 xx xx
         B0 B3 */
-    private static byte dg100CmdSetConfig[] =
-    { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x2A, (byte) 0xB8
-      , (byte) 0x02
-      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
-      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
-      , (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0xE8
-      , (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0xE8
-      , (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0xE8
-      , (byte) 0x00, (byte) 0x00
-      , (byte) 0x00, (byte) 0x00, (byte) 0x00
-      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
-      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
-      , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
-      , (byte) 0x01
-      , (byte) 0x00, (byte) 0x00, (byte) 0xB0, (byte) 0xB3
+    private static byte[] dg100CmdSetConfig =
+    {(byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x2A, (byte) 0xB8,
+     (byte) 0x02,
+     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+     (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0xE8,
+     (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0xE8,
+     (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0xE8,
+     (byte) 0x00, (byte) 0x00,
+     (byte) 0x00, (byte) 0x00, (byte) 0x00,
+     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+     (byte) 0x01,
+     (byte) 0x00, (byte) 0x00, (byte) 0xB0, (byte) 0xB3
     };
     /** read config: A0 A2 00 01 BF 00 BF B0 B3 */
@@ -121,9 +123,9 @@
     private boolean canceled = false;
 
-    public GlobalsatDg100(CommPortIdentifier portId){
+    public GlobalsatDg100(CommPortIdentifier portId) {
         this.portIdentifier = portId;
     }
 
-    public void cancel(){
+    public void cancel() {
         canceled = true;
         disconnect();
@@ -139,5 +141,5 @@
             GpxData result = null;
             canceled = false;
-            if(port == null){
+            if (port == null) {
                 connect();
             }
@@ -147,16 +149,16 @@
 
             progressMonitor.setTicksCount(gpsRecList.size());
-            if(gpsRecList.size() > 0){
+            if (gpsRecList.size() > 0) {
                 GpsRec last = null;
                 result = new GpxData();
                 Collection<WayPoint> seg = new ArrayList<>(100);
-                for(GpsRec r:gpsRecList){
-                    if(canceled){
+                for (GpsRec r:gpsRecList) {
+                    if (canceled) {
                         return result;
                     }
                     WayPoint p = wayPointFrom(r);
-                    if(r.equals(last)){
+                    if (r.equals(last)) {
                         result.waypoints.add(p);
-                    }else{
+                    } else {
                         seg.add(p);
                     }
@@ -172,27 +174,27 @@
     }
 
-    private WayPoint wayPointFrom(GpsRec r){
+    private WayPoint wayPointFrom(GpsRec r) {
         LatLon l = new LatLon(r.getLatitude(), r.getLongitude());
         WayPoint result = new WayPoint(l);
         result.attr.put("time", "" + r.getStringZuluTime());
         result.attr.put("speed", "" + r.getSpeed());
-        if(r.getDg100TypeOfCurRec() > 1)
+        if (r.getDg100TypeOfCurRec() > 1)
             result.attr.put("ele", "" + r.getAltitude());
         return result;
     }
 
-    public void deleteData() throws ConnectionException{
-        if(port == null){
+    public void deleteData() throws ConnectionException {
+        if (port == null) {
             connect();
         }
-        try{
+        try {
             sendCmdDelFiles();
-        }catch(Exception e){
-            throw new ConnectionException(e);
-        }
-    }
-
-    public void disconnect(){
-        if(port != null){
+        } catch (Exception e) {
+            throw new ConnectionException(e);
+        }
+    }
+
+    public void disconnect() {
+        if (port != null) {
             port.close();
             port = null;
@@ -200,24 +202,23 @@
     }
 
-    private void connect() throws ConnectionException{
-        try{
-            port = (SerialPort)portIdentifier.open("DG100", TIMEOUT);
+    private void connect() throws ConnectionException {
+        try {
+            port = (SerialPort) portIdentifier.open("DG100", TIMEOUT);
             port.setSerialPortParams(115200, SerialPort.DATABITS_8,
                                      SerialPort.STOPBITS_2, SerialPort.PARITY_NONE);
             port.notifyOnOutputEmpty(false);
 
-        }catch(PortInUseException e){
-            throw new ConnectionException(e);
-        }catch(UnsupportedCommOperationException e){
-            throw new ConnectionException(e);
-        }
-    }
-
-    private List<FileInfoRec> readFileInfoList() throws ConnectionException
-    {
+        } catch (PortInUseException e) {
+            throw new ConnectionException(e);
+        } catch (UnsupportedCommOperationException e) {
+            throw new ConnectionException(e);
+        }
+    }
+
+    private List<FileInfoRec> readFileInfoList() throws ConnectionException {
         int nextIdx = 0;
         List<FileInfoRec> result = new ArrayList<>(64);
-        try{
-            do{
+        try {
+            do {
                 Response<FileInfoRec> response = sendCmdGetFileInfo(nextIdx);
                 nextIdx = response.getNextIdx();
@@ -225,26 +226,24 @@
             } while (nextIdx > 0);
             return result;
-        }catch(Exception e){
-            throw new ConnectionException(e);
-        }
-    }
-
-    public List<GpsRec> readGpsRecList(List<FileInfoRec> fileInfoList) throws ConnectionException
-    {
+        } catch (Exception e) {
+            throw new ConnectionException(e);
+        }
+    }
+
+    public List<GpsRec> readGpsRecList(List<FileInfoRec> fileInfoList) throws ConnectionException {
         List<GpsRec> result = new ArrayList<>(200);
 
-        try{
-            for(FileInfoRec fileInfoRec:fileInfoList){
+        try {
+            for (FileInfoRec fileInfoRec:fileInfoList) {
                 Response<GpsRec> response = sendCmdGetGpsRecs(fileInfoRec.getIdx());
                 result.addAll(response.getRecs());
             }
             return result;
-        }catch(Exception e){
-            throw new ConnectionException(e);
-        }
-    }
-
-    private Response<?> sendCmdDelFiles() throws IOException, UnsupportedCommOperationException
-    {
+        } catch (Exception e) {
+            throw new ConnectionException(e);
+        }
+    }
+
+    private Response<?> sendCmdDelFiles() throws IOException, UnsupportedCommOperationException {
         System.out.println("deleting data...");
         int len = sendCmd(dg100CmdDelFile, response, -1);
@@ -253,10 +252,9 @@
 
     @SuppressWarnings("unchecked")
-    private Response<FileInfoRec> sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException
-    {
+    private Response<FileInfoRec> sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException {
         byte[] src = dg100CmdGetFileInfo;
         ByteBuffer buf = ByteBuffer.wrap(src);
         buf.position(5);
-        buf.putShort((short)idx); // index of first file info rec to be read
+        buf.putShort((short) idx); // index of first file info rec to be read
         updateCheckSum(buf);
         int len = sendCmd(src, response, -1);
@@ -264,6 +262,5 @@
     }
 
-    private Response<?> sendCmdGetConfig() throws IOException, UnsupportedCommOperationException
-    {
+    private Response<?> sendCmdGetConfig() throws IOException, UnsupportedCommOperationException {
         byte[] src = dg100CmdGetConfig;
         int len = sendCmd(src, response, -1);
@@ -271,20 +268,19 @@
     }
 
-    public Dg100Config getConfig() throws ConnectionException{
-        try{
-            if(port == null){
+    public Dg100Config getConfig() throws ConnectionException {
+        try {
+            if (port == null) {
                 connect();
             }
             return sendCmdGetConfig().getConfig();
-        }catch(Exception e){
-            throw new ConnectionException(e);
-        }
-    }
-
-    private void sendCmdSetConfig(Dg100Config config) throws IOException, UnsupportedCommOperationException
-    {
+        } catch (Exception e) {
+            throw new ConnectionException(e);
+        }
+    }
+
+    private void sendCmdSetConfig(Dg100Config config) throws IOException, UnsupportedCommOperationException {
         byte[] src = dg100CmdSetConfig;
         ByteBuffer buf = ByteBuffer.wrap(src);
-        if (config != null){
+        if (config != null) {
             config.write(buf);
         }
@@ -295,23 +291,22 @@
     }
 
-    public void setConfig(Dg100Config conf) throws ConnectionException{
-        try{
+    public void setConfig(Dg100Config conf) throws ConnectionException {
+        try {
             sendCmdSetConfig(conf);
-        }catch(Exception e){
-            throw new ConnectionException(e);
-        }
-    }
-
-    public boolean isCanceled(){
+        } catch (Exception e) {
+            throw new ConnectionException(e);
+        }
+    }
+
+    public boolean isCanceled() {
         return canceled;
     }
 
     @SuppressWarnings("unchecked")
-    private Response<GpsRec> sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException
-    {
+    private Response<GpsRec> sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException {
         byte[] src = dg100CmdGetGpsRecs;
         ByteBuffer buf = ByteBuffer.wrap(src);
         buf.position(5);
-        buf.putShort((short)idx); // index of first chunk of gps recs to be read
+        buf.putShort((short) idx); // index of first chunk of gps recs to be read
         updateCheckSum(buf);
         int len = sendCmd(src, response, 2074);
@@ -319,22 +314,16 @@
     }
 
-    /**
-     *
-     * @param buf
-     */
-    private void updateCheckSum(ByteBuffer buf)
-    {
+    private void updateCheckSum(ByteBuffer buf) {
         buf.position(2);
         short len = buf.getShort();
         int sum = 0;
-        for (int ii = 0 ; ii < len ; ++ii){
+        for (int ii = 0; ii < len; ++ii) {
             sum += ByteHelper.byte2IntUnsigned(buf.get());
         }
         sum = sum & 0x7FFF;
-        buf.putShort((short)sum);
-    }
-
-    private int sendCmd(byte cmdAndArgs[], byte response[], int bytesToRead) throws IOException, UnsupportedCommOperationException
-    {
+        buf.putShort((short) sum);
+    }
+
+    private int sendCmd(byte[] cmdAndArgs, byte[] response, int bytesToRead) throws IOException, UnsupportedCommOperationException {
 
         int cntBytTot = 0;
@@ -349,7 +338,5 @@
     }
 
-
-    private int readResponse(byte[] response, int bytesToRead) throws IOException, UnsupportedCommOperationException
-    {
+    private int readResponse(byte[] response, int bytesToRead) throws IOException, UnsupportedCommOperationException {
         byte[] readBuffer = new byte[200];
         int responsePos = 0;
@@ -359,15 +346,15 @@
         int cntBytTot = 0;
         InputStream inputStream = port.getInputStream();
-        if (inputStream != null){
+        if (inputStream != null) {
             ByteBuffer buf = ByteBuffer.wrap(response);
             port.enableReceiveThreshold(2); // read at least 2 byte
             boolean a0A2Received = false;
-            while (! a0A2Received){
+            while (!a0A2Received) {
                 response[0] = response[1];
                 int rcvd = inputStream.read(response, 1, 1);
-                if (rcvd == 0){
+                if (rcvd == 0) {
                     return 0;
                 }
-                a0A2Received = (response[0] == (byte)0xa0 && response[1] == (byte)0xa2);
+                a0A2Received = (response[0] == (byte) 0xa0 && response[1] == (byte) 0xa2);
             }
             // we already have read 2 bytes
@@ -376,5 +363,5 @@
             // read interesting data
             port.enableReceiveThreshold(2); // read at least 2 bytes
-            while (bytesToRead < 0 || (bytesToRead >= 0 && cntBytTot < bytesToRead)){
+            while (bytesToRead < 0 || (bytesToRead >= 0 && cntBytTot < bytesToRead)) {
                 int cntBytAct = 0;
                 cntBytAct = inputStream.read(readBuffer);
@@ -382,7 +369,7 @@
                 // copy readBuffer to response
                 responsePos = ByteHelper.copyByteArr2ByteArr(readBuffer, 0, cntBytAct, response, responsePos);
-                if (!headerReceived && cntBytTot >= 4){
+                if (!headerReceived && cntBytTot >= 4) {
                     // do we have enough bytes to extract bytesToRead
-                    if (bytesToRead == -1){
+                    if (bytesToRead == -1) {
                         // get bytesToRead from response
                         buf.position(2); // here starts length of payload
@@ -392,5 +379,5 @@
                     headerReceived = true;
                 }
-                if (cntBytAct == 0){
+                if (cntBytAct == 0) {
                     break;
                 }
Index: applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java
===================================================================
--- applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java	(revision 32648)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java	(revision 32649)
@@ -1,7 +1,6 @@
-// License: GPL v2 or later. Copyright 2007 by Raphael Mack, Immanuel Scholz and others
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.globalsat;
 
 import static org.openstreetmap.josm.tools.I18n.tr;
-import gnu.io.CommPortIdentifier;
 
 import java.awt.GridBagConstraints;
@@ -23,8 +22,10 @@
 import org.openstreetmap.josm.Main;
 
+import gnu.io.CommPortIdentifier;
+
 /**
  * Main download dialog.
  *
- * @author Raphael Mack <ramack@raphael-mack.de>
+ * @author Raphael Mack &lt;ramack@raphael-mack.de&gt;
  *
  */
@@ -41,8 +42,10 @@
 
         portCombo = new JComboBox<>();
-        portCombo.setRenderer(new ListCellRenderer<CommPortIdentifier>(){
-                public java.awt.Component getListCellRendererComponent(JList<? extends CommPortIdentifier> list, CommPortIdentifier o, int x, boolean a, boolean b){
+        portCombo.setRenderer(new ListCellRenderer<CommPortIdentifier>() {
+                @Override
+                public java.awt.Component getListCellRendererComponent(JList<? extends CommPortIdentifier> list,
+                        CommPortIdentifier o, int x, boolean a, boolean b) {
                     String value = o.getName();
-                    if(value == null){
+                    if (value == null) {
                         value = "null";
                     }
@@ -50,10 +53,11 @@
                 }
             });
-        portCombo.addActionListener(new ActionListener(){
-                public void actionPerformed(java.awt.event.ActionEvent e){
+        portCombo.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(java.awt.event.ActionEvent e) {
                     Object i = portCombo.getSelectedItem();
-                    if(i instanceof CommPortIdentifier){
-                        GlobalsatPlugin.setPortIdent((CommPortIdentifier)i);
-                        Main.pref.put("globalsat.portIdentifier", ((CommPortIdentifier)i).getName());
+                    if (i instanceof CommPortIdentifier) {
+                        GlobalsatPlugin.setPortIdent((CommPortIdentifier) i);
+                        Main.pref.put("globalsat.portIdentifier", ((CommPortIdentifier) i).getName());
                     }
                 }
@@ -61,5 +65,5 @@
 
         refreshPorts();
-        c.insets = new Insets(4,4,4,4);
+        c.insets = new Insets(4, 4, 4, 4);
         c.gridwidth = 1;
         c.weightx = 0.8;
@@ -76,6 +80,7 @@
 
         refreshBtn = new JButton(tr("Refresh"));
-        refreshBtn.addActionListener(new ActionListener(){
-                public void actionPerformed(java.awt.event.ActionEvent e){
+        refreshBtn.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(java.awt.event.ActionEvent e) {
                     refreshPorts();
                 }
@@ -90,8 +95,9 @@
 
         configBtn = new JButton(tr("Configure"));
-        configBtn.addActionListener(new ActionListener(){
-                public void actionPerformed(java.awt.event.ActionEvent e){
+        configBtn.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(java.awt.event.ActionEvent e) {
                     System.out.println("configureing the device");
-                    try{
+                    try {
 
                         GlobalsatConfigDialog dialog = new GlobalsatConfigDialog(GlobalsatPlugin.dg100().getConfig());
@@ -99,10 +105,10 @@
                         JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device"));
                         dlg.setVisible(true);
-                        if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
+                        if (((Integer) pane.getValue()) == JOptionPane.OK_OPTION) {
                             GlobalsatPlugin.dg100().setConfig(dialog.getConfig());
                         }
                         dlg.dispose();
 
-                    }catch(GlobalsatDg100.ConnectionException ex){
+                    } catch (GlobalsatDg100.ConnectionException ex) {
                         JOptionPane.showMessageDialog(Main.parent, tr("Connection Error.") + " " + ex.toString());
                     }
@@ -129,5 +135,5 @@
     }
 
-    public void refreshPorts(){
+    public void refreshPorts() {
         String sel = Main.pref.get("globalsat.portIdentifier");
         portCombo.setVisible(false);
@@ -135,9 +141,9 @@
 
         Enumeration<?> e = CommPortIdentifier.getPortIdentifiers();
-        for(e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements(); ){
-            CommPortIdentifier port = (CommPortIdentifier)e.nextElement();
-            if(port.getPortType() == CommPortIdentifier.PORT_SERIAL){
+        for (e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements();) {
+            CommPortIdentifier port = (CommPortIdentifier) e.nextElement();
+            if (port.getPortType() == CommPortIdentifier.PORT_SERIAL) {
                 portCombo.addItem(port);
-                if(sel != null && port.getName() == sel){
+                if (sel != null && port.getName() == sel) {
                     portCombo.setSelectedItem(port);
                     GlobalsatPlugin.setPortIdent(port);
@@ -150,10 +156,10 @@
     }
 
-    public boolean deleteFilesAfterDownload(){
+    public boolean deleteFilesAfterDownload() {
         return delete.isSelected();
     }
 
-    public CommPortIdentifier getPort(){
-        return (CommPortIdentifier)portCombo.getSelectedItem();
+    public CommPortIdentifier getPort() {
+        return (CommPortIdentifier) portCombo.getSelectedItem();
     }
 }
Index: applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java
===================================================================
--- applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java	(revision 32648)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java	(revision 32649)
@@ -1,6 +1,6 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.globalsat;
 /// @author Raphael Mack <ramack@raphael-mack.de>
 import static org.openstreetmap.josm.tools.I18n.tr;
-import gnu.io.CommPortIdentifier;
 
 import java.awt.GraphicsEnvironment;
@@ -23,12 +23,14 @@
 import org.xml.sax.SAXException;
 
+import gnu.io.CommPortIdentifier;
+
 public class GlobalsatPlugin extends Plugin {
     private static GlobalsatDg100 device = null;
-    public static GlobalsatDg100 dg100(){
+    public static GlobalsatDg100 dg100() {
         return device;
     }
 
-    public static void setPortIdent(CommPortIdentifier port){
-        if(device != null){
+    public static void setPortIdent(CommPortIdentifier port) {
+        if (device != null) {
             device.disconnect();
         }
@@ -41,5 +43,5 @@
         private boolean deleteAfter;
 
-        public ImportTask(boolean delete){
+        ImportTask(boolean delete) {
             super(tr("Importing data from device."));
             deleteAfter = delete;
@@ -48,7 +50,7 @@
         @Override public void realRun() throws IOException, SAXException {
             progressMonitor.subTask(tr("Importing data from DG100..."));
-            try{
+            try {
                 data = GlobalsatPlugin.dg100().readData(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, true));
-            }catch(Exception e){
+            } catch (Exception e) {
                 eee = e;
             }
@@ -56,21 +58,21 @@
 
         @Override protected void finish() {
-            if(deleteAfter && GlobalsatPlugin.dg100().isCanceled() == false){
+            if (deleteAfter && GlobalsatPlugin.dg100().isCanceled() == false) {
                 Main.pref.put("globalsat.deleteAfterDownload", true);
-                try{
+                try {
                     GlobalsatPlugin.dg100().deleteData();
-                }catch(Exception ex){
+                } catch (Exception ex) {
                     JOptionPane.showMessageDialog(Main.parent, tr("Error deleting data.") + " " + ex.toString());
                 }
-            }else{
+            } else {
                 Main.pref.put("globalsat.deleteAfterDownload", false);
             }
-            if(data != null && data.hasTrackPoints()){
+            if (data != null && data.hasTrackPoints()) {
                 Main.getLayerManager().addLayer(new GpxLayer(data, tr("imported data from {0}", "DG 100")));
                 Main.map.repaint();
-            }else{
+            } else {
                 JOptionPane.showMessageDialog(Main.parent, tr("No data found on device."));
             }
-            if(eee != null){
+            if (eee != null) {
                 eee.printStackTrace();
                 System.out.println(eee.getMessage());
@@ -94,8 +96,10 @@
         } catch (UnsatisfiedLinkError e) {
             error = true;
+            // CHECKSTYLE.OFF: LineLength
             String msg = tr("Cannot load library rxtxSerial. If you need support to install it try Globalsat homepage at http://www.raphael-mack.de/josm-globalsat-gpx-import-plugin/");
+            // CHECKSTYLE.ON: LineLength
             Main.error(msg);
             if (!GraphicsEnvironment.isHeadless()) {
-            	JOptionPane.showMessageDialog(Main.parent, "<html>" + msg + "</html>");
+                JOptionPane.showMessageDialog(Main.parent, "<html>" + msg + "</html>");
             }
         }
@@ -106,6 +110,6 @@
     }
 
-    class GlobalsatImportAction extends JosmAction{
-        public GlobalsatImportAction(){
+    class GlobalsatImportAction extends JosmAction {
+        GlobalsatImportAction() {
             super(tr("Globalsat Import"), "globalsatImport",
             tr("Import Data from Globalsat Datalogger DG100 into GPX layer."),
@@ -113,10 +117,12 @@
             KeyEvent.VK_G, Shortcut.ALT_CTRL), false);
         }
-        public void actionPerformed(ActionEvent e){
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
             GlobalsatImportDialog dialog = new GlobalsatImportDialog();
             JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
             JDialog dlg = pane.createDialog(Main.parent, tr("Import"));
             dlg.setVisible(true);
-            if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
+            if (((Integer) pane.getValue()) == JOptionPane.OK_OPTION) {
                 setPortIdent(dialog.getPort());
                 ImportTask task = new ImportTask(dialog.deleteFilesAfterDownload());
Index: applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/SingleSegmentGpxTrack.java
===================================================================
--- applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/SingleSegmentGpxTrack.java	(revision 32648)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/SingleSegmentGpxTrack.java	(revision 32649)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.globalsat;
 
@@ -19,16 +20,20 @@
     }
 
+    @Override
     public Map<String, Object> getAttributes() {
         return attr;
     }
 
+    @Override
     public Bounds getBounds() {
         return trackSegment.getBounds();
     }
 
+    @Override
     public Collection<GpxTrackSegment> getSegments() {
         return Collections.singleton(trackSegment);
     }
 
+    @Override
     public double length() {
         return trackSegment.length();
