Index: trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/SequenceCommand.java	(revision 7435)
+++ trunk/src/org/openstreetmap/josm/command/SequenceCommand.java	(revision 7436)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -69,5 +70,5 @@
         return sequence[sequence.length-1];
     }
-    
+
     protected final void undoCommands(int start) {
         // We probably aborted this halfway though the
@@ -114,9 +115,9 @@
         return prims;
     }
-    
+
     protected final void setSequence(Command[] sequence) {
-        this.sequence = Arrays.copyOf(sequence, sequence.length);
+        this.sequence = Utils.copyArray(sequence);
     }
-    
+
     protected final void setSequenceComplete(boolean sequenceComplete) {
         this.sequenceComplete = sequenceComplete;
Index: trunk/src/org/openstreetmap/josm/data/osm/Storage.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 7435)
+++ trunk/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 7436)
@@ -3,5 +3,4 @@
 
 import java.util.AbstractSet;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.ConcurrentModificationException;
@@ -10,4 +9,6 @@
 import java.util.NoSuchElementException;
 import java.util.Set;
+
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -148,5 +149,5 @@
     private void copyArray() {
         if (arrayCopyNecessary) {
-            data = Arrays.copyOf(data, data.length);
+            data = Utils.copyArray(data);
             arrayCopyNecessary = false;
         }
Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 7435)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 7436)
@@ -270,5 +270,5 @@
      */
     public static Class<Test>[] getAllAvailableTests() {
-        return Arrays.copyOf(allAvailableTests, allAvailableTests.length);
+        return Utils.copyArray(allAvailableTests);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 7435)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 7436)
@@ -342,5 +342,5 @@
         if (!canMoveStyles(sel, delta))
             return;
-        int[] selSorted = Arrays.copyOf(sel, sel.length);
+        int[] selSorted = Utils.copyArray(sel);
         Arrays.sort(selSorted);
         List<StyleSource> data = new ArrayList<>(styles.getStyleSources());
@@ -361,5 +361,5 @@
         if (sel.length == 0)
             return false;
-        int[] selSorted = Arrays.copyOf(sel, sel.length);
+        int[] selSorted = Utils.copyArray(sel);
         Arrays.sort(selSorted);
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/PuwgProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/PuwgProjectionChoice.java	(revision 7435)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/PuwgProjectionChoice.java	(revision 7436)
@@ -4,7 +4,8 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+
+import org.openstreetmap.josm.tools.Utils;
 
 public class PuwgProjectionChoice extends ListProjectionChoice {
@@ -46,5 +47,5 @@
     @Override
     public String[] allCodes() {
-        return Arrays.copyOf(CODES, CODES.length);
+        return Utils.copyArray(CODES);
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 7435)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 7436)
@@ -311,4 +311,17 @@
 
     /**
+     * Copies the given array. Unlike {@link Arrays#copyOf}, this method is null-safe.
+     * @param array The array to copy
+     * @return A copy of the original array, or {@code null} if {@code array} is null
+     * @since 7436
+     */
+    public static int[] copyArray(int[] array) {
+        if (array != null) {
+            return Arrays.copyOf(array, array.length);
+        }
+        return null;
+    }
+
+    /**
      * Simple file copy function that will overwrite the target file.<br>
      * @param in The source file
