Index: applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Response.java
===================================================================
--- applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Response.java	(revision 30197)
+++ applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Response.java	(revision 30532)
@@ -12,5 +12,5 @@
  *
  */
-public class Response
+public class Response<E>
 {
     final static public byte typeFileInfo = (byte)0xBB;
@@ -23,5 +23,5 @@
     private int nextIdx = 0;
     private Dg100Config config = null;
-    private List data = new ArrayList(100);
+    private List<E> data = new ArrayList<>(100);
     private long id = 0;
 
@@ -35,12 +35,12 @@
      * @param resp
      */
-    static public Response parseResponse(byte resp[], int len)
+    static public Response<?> parseResponse(byte resp[], int len)
     {
         ByteBuffer buf = ByteBuffer.wrap(resp);
         byte respType = buf.get(4);
-        Response response = new Response(respType);
         buf.position(5);
         if (respType == typeFileInfo) // file info
         {
+            Response<FileInfoRec> response = new Response<>(respType);
             int cntInfoCur = buf.getShort();
             int nextIdx = buf.getShort();
@@ -52,7 +52,9 @@
                 response.addRec(fileInfoRec);
             }
+            return response;
         }
         else if (respType == typeGpsRec) // gps recs
         {
+            Response<GpsRec> response = new Response<>(respType);
             int recType = 2;
             // read part 1
@@ -85,12 +87,16 @@
                 recType = gpsRec.getDg100TypeOfNextRec();
             }
+            return response;
         }
         else if (respType == typeConfig) // config
         {
+            Response<?> response = new Response<>(respType);
             Dg100Config config = new Dg100Config(buf);
             response.config = config;
+            return response;
         }
         else if (respType == typeId) // id
         {
+            Response<?> response = new Response<>(respType);
             response.id = 0;
             for (int ii = 0 ; ii < 8 ; ++ii)
@@ -99,17 +105,18 @@
                 response.id = response.id * 10 + digit;
             }
+            return response;
         }
         else
         {
+            return new Response<>(respType);
         }
-        return response;
     }
 
-    private void addRec(Object obj)
+    private void addRec(E obj)
     {
         data.add(obj);
     }
 
-    public List getRecs()
+    public List<E> getRecs()
     {
         return data;
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 30197)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java	(revision 30532)
@@ -5,5 +5,4 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
-import gnu.io.CommPortIdentifier;
 
 import java.awt.Dimension;
@@ -13,11 +12,8 @@
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
-import java.util.LinkedList;
-import java.util.List;
 
 import javax.swing.BoxLayout;
 import javax.swing.ButtonGroup;
 import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
@@ -28,5 +24,4 @@
 import org.kaintoch.gps.globalsat.dg100.Dg100Config;
 import org.openstreetmap.josm.Main;
-
 
 /**
@@ -55,10 +50,4 @@
     }
 
-
-
-    // the JOptionPane that contains this dialog. required for the closeDialog() method.
-    private JOptionPane optionPane;
-    private JCheckBox delete;
-    private JComboBox portCombo;
     private JRadioButton formatPosOnly = new JRadioButton(tr("Position only"));
     private JRadioButton formatPosTDS = new JRadioButton(tr("Position, Time, Date, Speed"));
@@ -79,13 +68,8 @@
     private JTextField cMeters = new IntegerTextField();
 
-    private JLabel memUsage = new JLabel();
-
     private JCheckBox disableLogDist, disableLogSpeed;
     private JTextField minLogDist, minLogSpeed;
 
-    private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>();
-
     private Dg100Config conf;
-
 
     public GlobalsatConfigDialog(Dg100Config config) {
@@ -326,12 +310,4 @@
 
     /**
-     * Has to be called after this dialog has been added to a JOptionPane.
-     * @param optionPane
-     */
-    public void setOptionPane(JOptionPane optionPane) {
-        this.optionPane = optionPane;
-    }
-
-    /**
      * Get the selected configuration.
      */
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 30197)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java	(revision 30532)
@@ -50,5 +50,5 @@
 
     /** delete file: A0 A2 00 02 BC 01 00 BD B0 B3 */
-    private static byte dg100CmdSwitch2Nmea[] =
+    /*private static byte dg100CmdSwitch2Nmea[] =
     { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x18, (byte) 0x81,
       (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x01,
@@ -58,10 +58,10 @@
       (byte) 0x00, (byte) 0x25, (byte) 0x80, (byte) 0x00, (byte) 0x00,
       (byte) 0xB0, (byte) 0xB3
-    };
+    };*/
     /** delete file: A0 A2 00 02 BC 01 00 BD B0 B3 */
-    private static byte dg100CmdEnterGMouse[] =
+    /*private static byte dg100CmdEnterGMouse[] =
     { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x02, (byte) 0xBC
       , (byte) 0x01, (byte) 0x00, (byte) 0xBD, (byte) 0xB0, (byte) 0xB3
-    };
+    };*/
     /** delete file: A0 A2 00 03 BA FF FF 02 B8 B0 B3 */
     private static byte dg100CmdDelFile[] =
@@ -104,13 +104,13 @@
     };
     /** read config: A0 A2 00 01 BF 00 BF B0 B3 */
-    private static byte dg100CmdGetId[] =
+    /*private static byte dg100CmdGetId[] =
     { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x01, (byte) 0xBF
-      , (byte) 0x00, (byte) 0xBF, (byte) 0xB0, (byte) 0xB3 };
+      , (byte) 0x00, (byte) 0xBF, (byte) 0xB0, (byte) 0xB3 };*/
     /** read config: A0 A2 00 01 BF 00 BF B0 B3 */
-    private static byte dg100CmdSetId[] =
+    /*private static byte dg100CmdSetId[] =
     { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x09, (byte) 0xC0
       , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
       , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
-      , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3};
+      , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3};*/
 
     private byte[] response = new byte[65536];
@@ -187,5 +187,5 @@
         }
         try{
-            Response response = sendCmdDelFiles();
+            sendCmdDelFiles();
         }catch(Exception e){
             throw new ConnectionException(e);
@@ -220,5 +220,5 @@
         try{
             do{
-                Response response = sendCmdGetFileInfo(nextIdx);
+                Response<FileInfoRec> response = sendCmdGetFileInfo(nextIdx);
                 nextIdx = response.getNextIdx();
                 result.addAll(response.getRecs());
@@ -232,11 +232,9 @@
     public List<GpsRec> readGpsRecList(List<FileInfoRec> fileInfoList) throws ConnectionException
     {
-        int cnt = 0;
         List<GpsRec> result = new ArrayList<GpsRec>(200);
 
         try{
             for(FileInfoRec fileInfoRec:fileInfoList){
-                cnt++;
-                Response response = sendCmdGetGpsRecs(fileInfoRec.getIdx());
+                Response<GpsRec> response = sendCmdGetGpsRecs(fileInfoRec.getIdx());
                 result.addAll(response.getRecs());
             }
@@ -247,5 +245,5 @@
     }
 
-    private Response sendCmdDelFiles() throws IOException, UnsupportedCommOperationException
+    private Response<?> sendCmdDelFiles() throws IOException, UnsupportedCommOperationException
     {
         System.out.println("deleting data...");
@@ -254,5 +252,6 @@
     }
 
-    private Response sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException
+    @SuppressWarnings("unchecked")
+    private Response<FileInfoRec> sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException
     {
         byte[] src = dg100CmdGetFileInfo;
@@ -262,8 +261,8 @@
         updateCheckSum(buf);
         int len = sendCmd(src, response, -1);
-        return Response.parseResponse(response, len);
-    }
-
-    private Response sendCmdGetConfig() throws IOException, UnsupportedCommOperationException
+        return (Response<FileInfoRec>) Response.parseResponse(response, len);
+    }
+
+    private Response<?> sendCmdGetConfig() throws IOException, UnsupportedCommOperationException
     {
         byte[] src = dg100CmdGetConfig;
@@ -277,11 +276,9 @@
                 connect();
             }
-            Response response = sendCmdGetConfig();
-            return response.getConfig();
+            return sendCmdGetConfig().getConfig();
         }catch(Exception e){
             throw new ConnectionException(e);
         }
     }
-
 
     private void sendCmdSetConfig(Dg100Config config) throws IOException, UnsupportedCommOperationException
@@ -310,5 +307,6 @@
     }
 
-    private Response sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException
+    @SuppressWarnings("unchecked")
+    private Response<GpsRec> sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException
     {
         byte[] src = dg100CmdGetGpsRecs;
@@ -318,5 +316,5 @@
         updateCheckSum(buf);
         int len = sendCmd(src, response, 2074);
-        return Response.parseResponse(response, len);
+        return (Response<GpsRec>) Response.parseResponse(response, len);
     }
 
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 30197)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java	(revision 30532)
@@ -10,6 +10,4 @@
 import java.awt.event.ActionListener;
 import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.List;
 
 import javax.swing.JButton;
@@ -33,9 +31,6 @@
 public class GlobalsatImportDialog extends JPanel {
 
-    // the JOptionPane that contains this dialog. required for the closeDialog() method.
-    private JOptionPane optionPane;
     private JCheckBox delete;
-    private JComboBox portCombo;
-    private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>();
+    private JComboBox<CommPortIdentifier> portCombo;
 
     public GlobalsatImportDialog() {
@@ -45,8 +40,8 @@
         setLayout(new GridBagLayout());
 
-        portCombo = new JComboBox();
-        portCombo.setRenderer(new ListCellRenderer(){
-                public java.awt.Component getListCellRendererComponent(JList list, Object o, int x, boolean a, boolean b){
-                    String value = ((CommPortIdentifier)o).getName();
+        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){
+                    String value = o.getName();
                     if(value == null){
                         value = "null";
@@ -103,5 +98,4 @@
                         JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
                         JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device"));
-                        dialog.setOptionPane(pane);
                         dlg.setVisible(true);
                         if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
@@ -140,5 +134,5 @@
         portCombo.removeAllItems();
 
-        Enumeration e = CommPortIdentifier.getPortIdentifiers();
+        Enumeration<?> e = CommPortIdentifier.getPortIdentifiers();
         for(e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements(); ){
             CommPortIdentifier port = (CommPortIdentifier)e.nextElement();
@@ -163,10 +157,3 @@
         return (CommPortIdentifier)portCombo.getSelectedItem();
     }
-    /**
-     * Has to be called after this dialog has been added to a JOptionPane.
-     * @param optionPane
-     */
-    public void setOptionPane(JOptionPane optionPane) {
-        this.optionPane = optionPane;
-    }
 }
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 30197)
+++ applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java	(revision 30532)
@@ -7,5 +7,4 @@
 import java.awt.event.KeyEvent;
 import java.io.IOException;
-import java.util.Enumeration;
 
 import javax.swing.JDialog;
@@ -86,5 +85,4 @@
     }
 
-
     GlobalsatImportAction importAction;
     public GlobalsatPlugin(PluginInformation info) {
@@ -92,5 +90,5 @@
         boolean error = false;
         try{
-            Enumeration e = CommPortIdentifier.getPortIdentifiers();
+            CommPortIdentifier.getPortIdentifiers();
         }catch(java.lang.UnsatisfiedLinkError e){
             error = true;
@@ -114,5 +112,4 @@
             JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
             JDialog dlg = pane.createDialog(Main.parent, tr("Import"));
-            dialog.setOptionPane(pane);
             dlg.setVisible(true);
             if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
