Index: applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java
===================================================================
--- applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java	(revision 30737)
+++ applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java	(revision 30738)
@@ -68,7 +68,7 @@
             // @see LiveGpsLayer
             PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(tmpFile)));
-            GpxWriter gpxWriter = new GpxWriter(out);
-            gpxWriter.write(gpsLayer.data);
-            gpxWriter.close();
+            try (GpxWriter gpxWriter = new GpxWriter(out)) {
+            	gpxWriter.write(gpsLayer.data);
+            }
             tmpFile.renameTo(file);
         } catch (IOException ioExc) {
Index: applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java
===================================================================
--- applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java	(revision 30737)
+++ applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java	(revision 30738)
@@ -26,7 +26,7 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.XmlObjectParser;
-import org.openstreetmap.josm.actions.JosmAction;
 import org.xml.sax.SAXException;
 
@@ -50,5 +50,6 @@
     }
 
-    public void actionPerformed(ActionEvent e) {
+    @Override
+	public void actionPerformed(ActionEvent e) {
         if(surveyorFrame == null) {
             surveyorFrame = new JFrame();
@@ -64,5 +65,6 @@
             // zoomout:
             actionMap.put("zoomout", new AbstractAction() {
-                public void actionPerformed(ActionEvent e) {
+                @Override
+				public void actionPerformed(ActionEvent e) {
                     if(Main.map != null && Main.map.mapView != null) {
                         Main.map.mapView.zoomToFactor(2);
@@ -73,5 +75,6 @@
             // zoomin:
             actionMap.put("zoomin", new AbstractAction() {
-                public void actionPerformed(ActionEvent e) {
+                @Override
+				public void actionPerformed(ActionEvent e) {
                     if(Main.map != null && Main.map.mapView != null) {
                         Main.map.mapView.zoomToFactor(1/2);
@@ -82,5 +85,6 @@
             // autocenter:
             actionMap.put("autocenter", new AbstractAction() {
-                public void actionPerformed(ActionEvent e) {
+                @Override
+				public void actionPerformed(ActionEvent e) {
                     // toggle autocenter
                     gpsPlugin.setAutoCenter(!gpsPlugin.isAutoCenter());
@@ -105,5 +109,4 @@
 
     public SurveyorComponent createComponent() {
-        InputStream in = null;
         String source = Main.pref.get("surveyor.source");
         if(source == null || source.length() == 0) {
@@ -114,18 +117,14 @@
             // </FIXXME>
         }
-        SurveyorComponent component= null;
-        try {
-            in = ResourceLoader.getInputStream(source);
-            component = createComponent(in);
-            in.close();
-            return component;
+        try (InputStream in = ResourceLoader.getInputStream(source)) {
+            return createComponent(in);
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
             JOptionPane.showMessageDialog(Main.parent, tr("Could not read surveyor definition: {0}",source));
         } catch (SAXException e) {
-            e.printStackTrace();
+            Main.error(e);
             JOptionPane.showMessageDialog(Main.parent, tr("Error parsing {0}: {1}", source, e.getMessage()));
         }
-        return component;
+        return null;
     }
 
Index: applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/ResourceLoader.java
===================================================================
--- applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/ResourceLoader.java	(revision 30737)
+++ applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/ResourceLoader.java	(revision 30738)
@@ -28,5 +28,6 @@
      * @throws IOException if an error occurs on opening the url, or if the file is not found.
      */
-    public static InputStream getInputStream(String source) throws IOException {
+    @SuppressWarnings("resource")
+	public static InputStream getInputStream(String source) throws IOException {
         InputStream in = null;
         if (source.startsWith("http://") || source.startsWith("https://") || source.startsWith("ftp://") || source.startsWith("file:")) {
