Index: trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHook.java	(revision 12278)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHook.java	(revision 12279)
@@ -257,8 +257,8 @@
                 Main.parent,
                 tr("Outdated Java version"),
-                new String[]{tr("OK"), tr("Update Java"), tr("Cancel")});
+                tr("OK"), tr("Update Java"), tr("Cancel"));
         // Check if the dialog has not already been permanently hidden by user
         if (!ed.toggleEnable("askUpdateJava"+updVersion).toggleCheckState()) {
-            ed.setButtonIcons(new String[]{"ok", "java", "cancel"}).setCancelButton(3);
+            ed.setButtonIcons("ok", "java", "cancel").setCancelButton(3);
             ed.setMinimumSize(new Dimension(480, 300));
             ed.setIcon(JOptionPane.WARNING_MESSAGE);
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java	(revision 12278)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java	(revision 12279)
@@ -130,5 +130,5 @@
             Class<?> eawtFullScreenUtilities = Class.forName("com.apple.eawt.FullScreenUtilities");
             eawtFullScreenUtilities.getDeclaredMethod("setWindowCanFullScreen",
-                    new Class[]{Window.class, boolean.class}).invoke(eawtFullScreenUtilities, window, Boolean.TRUE);
+                    Window.class, boolean.class).invoke(eawtFullScreenUtilities, window, Boolean.TRUE);
         } catch (ReflectiveOperationException | SecurityException | IllegalArgumentException e) {
             Main.warn("Failed to register with OSX: " + e);
Index: trunk/src/org/openstreetmap/josm/tools/Shortcut.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 12278)
+++ trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 12279)
@@ -183,7 +183,7 @@
 
     private void saveDefault() {
-        Main.pref.getCollection("shortcut.entry."+shortText, Arrays.asList(new String[]{longText,
-        String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(requestedKey),
-        String.valueOf(getGroupModifier(requestedGroup)), String.valueOf(true), String.valueOf(false)}));
+        Main.pref.getCollection("shortcut.entry."+shortText, Arrays.asList(longText,
+            String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(requestedKey),
+            String.valueOf(getGroupModifier(requestedGroup)), String.valueOf(true), String.valueOf(false)));
     }
 
@@ -193,7 +193,7 @@
             return Main.pref.putCollection("shortcut.entry."+shortText, null);
         } else {
-            return Main.pref.putCollection("shortcut.entry."+shortText, Arrays.asList(new String[]{longText,
-            String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(assignedKey),
-            String.valueOf(assignedModifier), String.valueOf(assignedDefault), String.valueOf(assignedUser)}));
+            return Main.pref.putCollection("shortcut.entry."+shortText, Arrays.asList(longText,
+                String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(assignedKey),
+                String.valueOf(assignedModifier), String.valueOf(assignedDefault), String.valueOf(assignedUser)));
         }
     }
Index: trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/TextTagParser.java	(revision 12278)
+++ trunk/src/org/openstreetmap/josm/tools/TextTagParser.java	(revision 12279)
@@ -281,6 +281,6 @@
                     Main.parent,
                     tr("Do you want to paste these tags?"),
-                    new String[]{tr("Ok"), tr("Cancel"), tr("Clear buffer"), tr("Ignore warnings")});
-        ed.setButtonIcons(new String[]{"ok", "cancel", "dialogs/delete", "pastetags"});
+                    tr("Ok"), tr("Cancel"), tr("Clear buffer"), tr("Ignore warnings"));
+        ed.setButtonIcons("ok", "cancel", "dialogs/delete", "pastetags");
         ed.setContent("<html><b>"+text + "</b><br/><br/><div width=\"300px\">"+XmlWriter.encode(data, true)+"</html>");
         ed.setDefaultButton(2);
@@ -314,18 +314,16 @@
                     Main.parent,
                     tr("Warning"),
-                    new String[]{tr("Ok"), tr("Clear buffer")});
-
-        ed.setButtonIcons(new String[]{"ok", "dialogs/delete"});
-
-        ed.setContent(p);
-        ed.setDefaultButton(1);
-        ed.setCancelButton(1);
-        ed.setIcon(JOptionPane.WARNING_MESSAGE);
-        ed.toggleEnable("tags.paste.cleanbadbuffer");
+                    tr("Ok"), tr("Clear buffer"))
+            .setButtonIcons("ok", "dialogs/delete")
+            .setContent(p)
+            .setDefaultButton(1)
+            .setCancelButton(1)
+            .setIcon(JOptionPane.WARNING_MESSAGE)
+            .toggleEnable("tags.paste.cleanbadbuffer");
+
         ed.showDialog();
 
-        int r = ed.getValue();
         // clean clipboard if user asked
-        if (r == 2) ClipboardUtils.copyString("");
+        if (ed.getValue() == 2) ClipboardUtils.copyString("");
     }
 }
Index: trunk/src/org/openstreetmap/josm/tools/WinRegistry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/WinRegistry.java	(revision 12278)
+++ trunk/src/org/openstreetmap/josm/tools/WinRegistry.java	(revision 12279)
@@ -137,11 +137,10 @@
     private static String readString(Preferences root, int hkey, String key, String value)
             throws IllegalAccessException, InvocationTargetException {
-        int[] handles = (int[]) regOpenKey.invoke(root,
-                new Object[] { Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ) });
+        int[] handles = (int[]) regOpenKey.invoke(root, Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ));
         if (handles[1] != REG_SUCCESS) {
             return null;
         }
-        byte[] valb = (byte[]) regQueryValueEx.invoke(root, new Object[] { Integer.valueOf(handles[0]), toCstr(value) });
-        regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
+        byte[] valb = (byte[]) regQueryValueEx.invoke(root, Integer.valueOf(handles[0]), toCstr(value));
+        regCloseKey.invoke(root, Integer.valueOf(handles[0]));
         return (valb != null ? new String(valb, StandardCharsets.UTF_8).trim() : null);
     }
@@ -150,20 +149,18 @@
             throws IllegalAccessException, InvocationTargetException {
         HashMap<String, String> results = new HashMap<>();
-        int[] handles = (int[]) regOpenKey.invoke(root,
-                new Object[] { Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ) });
+        int[] handles = (int[]) regOpenKey.invoke(root, Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ));
         if (handles[1] != REG_SUCCESS) {
             return null;
         }
-        int[] info = (int[]) regQueryInfoKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
+        int[] info = (int[]) regQueryInfoKey.invoke(root, Integer.valueOf(handles[0]));
 
         int count = info[0]; // count
         int maxlen = info[3]; // value length max
         for (int index = 0; index < count; index++) {
-            byte[] name = (byte[]) regEnumValue.invoke(root,
-                    new Object[] { Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1) });
+            byte[] name = (byte[]) regEnumValue.invoke(root, Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1));
             String value = readString(hkey, key, new String(name, StandardCharsets.UTF_8));
             results.put(new String(name, StandardCharsets.UTF_8).trim(), value);
         }
-        regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
+        regCloseKey.invoke(root, Integer.valueOf(handles[0]));
         return results;
     }
@@ -172,19 +169,17 @@
             throws IllegalAccessException, InvocationTargetException {
         List<String> results = new ArrayList<>();
-        int[] handles = (int[]) regOpenKey.invoke(root,
-                new Object[] { Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ) });
+        int[] handles = (int[]) regOpenKey.invoke(root, Integer.valueOf(hkey), toCstr(key), Integer.valueOf(KEY_READ));
         if (handles[1] != REG_SUCCESS) {
             return Collections.emptyList();
         }
-        int[] info = (int[]) regQueryInfoKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
+        int[] info = (int[]) regQueryInfoKey.invoke(root, Integer.valueOf(handles[0]));
 
         int count = info[0]; // Fix: info[2] was being used here with wrong results. Suggested by davenpcj, confirmed by Petrucio
         int maxlen = info[3]; // value length max
         for (int index = 0; index < count; index++) {
-            byte[] name = (byte[]) regEnumKeyEx.invoke(root,
-                    new Object[] { Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1) });
+            byte[] name = (byte[]) regEnumKeyEx.invoke(root, Integer.valueOf(handles[0]), Integer.valueOf(index), Integer.valueOf(maxlen + 1));
             results.add(new String(name, StandardCharsets.UTF_8).trim());
         }
-        regCloseKey.invoke(root, new Object[] { Integer.valueOf(handles[0]) });
+        regCloseKey.invoke(root, Integer.valueOf(handles[0]));
         return results;
     }
Index: trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 12278)
+++ trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 12279)
@@ -153,5 +153,5 @@
                     Method m = entry.getMethod(fieldName);
                     if (m != null) {
-                        m.invoke(c, new Object[]{getValueForClass(m.getParameterTypes()[0], value)});
+                        m.invoke(c, getValueForClass(m.getParameterTypes()[0], value));
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/tools/template_engine/Tokenizer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/template_engine/Tokenizer.java	(revision 12278)
+++ trunk/src/org/openstreetmap/josm/tools/template_engine/Tokenizer.java	(revision 12279)
@@ -43,5 +43,5 @@
     public enum TokenType { CONDITION_START, VARIABLE_START, CONTEXT_SWITCH_START, END, PIPE, APOSTROPHE, TEXT, EOF }
 
-    private final Set<Character> specialCharaters = new HashSet<>(Arrays.asList(new Character[] {'$', '?', '{', '}', '|', '\'', '!'}));
+    private final Set<Character> specialCharaters = new HashSet<>(Arrays.asList('$', '?', '{', '}', '|', '\'', '!'));
 
     private final String template;
