Index: applications/editors/josm/plugins/opendata/src/org/geotools/data/shapefile/files/TabFiles.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/geotools/data/shapefile/files/TabFiles.java	(revision 30565)
+++ applications/editors/josm/plugins/opendata/src/org/geotools/data/shapefile/files/TabFiles.java	(revision 30566)
@@ -57,5 +57,5 @@
      * key is the type of file
      */
-    private final Map<ShpFileType, URL> urls = new ConcurrentHashMap<ShpFileType, URL>();
+    private final Map<ShpFileType, URL> urls = new ConcurrentHashMap<>();
 
     /**
@@ -68,5 +68,5 @@
      * the locks
      */
-    private final Map<Thread, Collection<ShpFilesLocker>> lockers = new ConcurrentHashMap<Thread, Collection<ShpFilesLocker>>();
+    private final Map<Thread, Collection<ShpFilesLocker>> lockers = new ConcurrentHashMap<>();
 
     /**
@@ -144,5 +144,5 @@
         if (isLocalTab()) {
             Set<Entry<ShpFileType, URL>> entries = urls.entrySet();
-            Map<ShpFileType, URL> toUpdate = new HashMap<ShpFileType, URL>();
+            Map<ShpFileType, URL> toUpdate = new HashMap<>();
             for (Entry<ShpFileType, URL> entry : entries) {
                 if( !existsTab(entry.getKey()) ){
@@ -222,5 +222,5 @@
      */
     public Map<ShpFileType, String> getFileNames() {
-        Map<ShpFileType, String> result = new HashMap<ShpFileType, String>();
+        Map<ShpFileType, String> result = new HashMap<>();
         Set<Entry<ShpFileType, URL>> entries = urls.entrySet();
 
@@ -342,15 +342,15 @@
         URL url = urls.get(type);
         if (url == null) {
-            return new Result<URL, State>(null, State.NOT_EXIST);
+            return new Result<>(null, State.NOT_EXIST);
         }
         
         boolean locked = readWriteLock.readLock().tryLock();
         if (!locked) {
-            return new Result<URL, State>(null, State.LOCKED);
+            return new Result<>(null, State.LOCKED);
         }
         
         getCurrentThreadLockers().add(new ShpFilesLocker(url, requestor));
 
-        return new Result<URL, State>(url, State.GOOD);
+        return new Result<>(url, State.GOOD);
     }
 
@@ -390,5 +390,5 @@
         }
 
-        Collection threadLockers = getCurrentThreadLockers();
+        Collection<ShpFilesLocker> threadLockers = getCurrentThreadLockers();
         boolean removed = threadLockers.remove(new ShpFilesLocker(url, requestor));
         if (!removed) {
@@ -489,5 +489,5 @@
         URL url = urls.get(type);
         if (url == null) {
-            return new Result<URL, State>(null, State.NOT_EXIST);
+            return new Result<>(null, State.NOT_EXIST);
         }
 
@@ -500,10 +500,10 @@
             if(locked == false) {
                 regainReadLocks(threadLockers);
-                return new Result<URL, State>(null, State.LOCKED);
+                return new Result<>(null, State.LOCKED);
             }
         }
 
         threadLockers.add(new ShpFilesLocker(url, requestor));
-        return new Result<URL, State>(url, State.GOOD);
+        return new Result<>(url, State.GOOD);
     }
 
@@ -568,5 +568,5 @@
         Collection<ShpFilesLocker> threadLockers = lockers.get(Thread.currentThread());
         if(threadLockers == null) {
-            threadLockers = new ArrayList<ShpFilesLocker>();
+            threadLockers = new ArrayList<>();
             lockers.put(Thread.currentThread(), threadLockers);
         }
@@ -771,4 +771,5 @@
                 File file = DataUtilities.urlToFile(url);
                 
+                @SuppressWarnings("resource")
                 RandomAccessFile raf = new RandomAccessFile(file, "r");
                 channel = new FileChannelDecorator(raf.getChannel(), this, url,
@@ -828,4 +829,5 @@
                 File file = DataUtilities.urlToFile(url);
 
+                @SuppressWarnings("resource")
                 RandomAccessFile raf = new RandomAccessFile(file, "rw");
                 channel = new FileChannelDecorator(raf.getChannel(), this, url,
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java	(revision 30565)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java	(revision 30566)
@@ -5,4 +5,5 @@
 
 import java.awt.Component;
+import java.awt.GraphicsEnvironment;
 import java.io.BufferedReader;
 import java.io.File;
@@ -89,5 +90,5 @@
     			if (desc != null && desc.getCoordinateReferenceSystem() != null) {
     				crs = desc.getCoordinateReferenceSystem();
-    			} else {
+    			} else if (!GraphicsEnvironment.isHeadless()) {
     			    GuiHelper.runInEDTAndWait(new Runnable() {
                         @Override
