Index: /trunk/src/org/openstreetmap/josm/gui/animation/DropImage.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/animation/DropImage.java	(revision 18930)
+++ /trunk/src/org/openstreetmap/josm/gui/animation/DropImage.java	(revision 18931)
@@ -68,9 +68,9 @@
         String name = "logo";
         try {
-            ArrayList<String> result = new ArrayList<String>();
+            ArrayList<String> result = new ArrayList<>();
             String path = "images/presets/";
             URL url = DropImage.class.getClassLoader().getResource(path);
             if (url != null && url.getProtocol().equals("file")) {
-                ArrayList<File> dirs = new ArrayList<File>();
+                ArrayList<File> dirs = new ArrayList<>();
                 dirs.add(new File(url.toURI()));
                 do {
@@ -82,14 +82,15 @@
                         }
                     }
-                } while (dirs.size() > 0);
+                } while (!dirs.isEmpty());
                 name = result.get(seed.nextInt(result.size()));
             } else if (url != null && url.getProtocol().equals("jar")) {
                 String jarPath = url.getPath().substring(5, url.getPath().indexOf("!"));
-                JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
-                Enumeration<JarEntry> entries = jar.entries();
-                while (entries.hasMoreElements()) {
-                    String fileName = entries.nextElement().getName();
-                    if (fileName.startsWith(path) && !fileName.endsWith("/")) {
-                        result.add(fileName.substring(7));
+                try (JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"))) {
+                    Enumeration<JarEntry> entries = jar.entries();
+                    while (entries.hasMoreElements()) {
+                        String fileName = entries.nextElement().getName();
+                        if (fileName.startsWith(path) && !fileName.endsWith("/")) {
+                            result.add(fileName.substring(7));
+                        }
                     }
                 }
