Index: trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java	(revision 6221)
+++ trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java	(revision 6222)
@@ -23,4 +23,6 @@
 import java.io.InputStream;
 import java.io.Serializable;
+
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -216,5 +218,4 @@
      * @param gs GridShift object containing the coordinate to shift and the shift values
      * @return the GridShift object supplied, with values updated.
-     * @throws IOException
      */
     public NTV2GridShift interpolateGridShift(NTV2GridShift gs) {
@@ -281,5 +282,5 @@
      */
     public void setSubGridArray(NTV2SubGrid[] subGrid) {
-        this.subGrid = subGrid;
+        this.subGrid = Utils.copyArray(subGrid);
     }
 
@@ -369,4 +370,3 @@
         return minLon;
     }
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java	(revision 6221)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java	(revision 6222)
@@ -5,4 +5,6 @@
 import static org.openstreetmap.josm.gui.conflict.pair.ListRole.THEIR_ENTRIES;
 import static org.openstreetmap.josm.tools.I18n.tr;
+
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -33,5 +35,5 @@
     ComparePairType(String displayName, ListRole[] participatingRoles) {
         this.displayName = displayName;
-        this.participatingRoles = participatingRoles;
+        this.participatingRoles = Utils.copyArray(participatingRoles);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java	(revision 6221)
+++ trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java	(revision 6222)
@@ -8,4 +8,5 @@
 import org.openstreetmap.josm.gui.history.TwoColumnDiff.Item.DiffItemType;
 import org.openstreetmap.josm.tools.Diff;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -54,14 +55,12 @@
     Object[] current;
 
-    /**
-     * The arguments will _not_ be modified
-     */
     public TwoColumnDiff(Object[] reference, Object[] current) {
-        this.reference = reference;
-        this.current = current;
+        this.reference = Utils.copyArray(reference);
+        this.current = Utils.copyArray(current);
         referenceDiff = new ArrayList<Item>();
         currentDiff = new ArrayList<Item>();
         diff();
     }
+    
     private void diff() {
         Diff diff = new Diff(reference, current);
@@ -82,5 +81,4 @@
             int inserted = script.inserted;
             while(ia < script.line0 && ib < script.line1){
-                // System.out.println(" "+a[ia] + "\t "+b[ib]);
                 Item cell = new Item(DiffItemType.SAME, a[ia]);
                 referenceDiff.add(cell);
@@ -92,13 +90,10 @@
             while(inserted > 0 || deleted > 0) {
                 if(inserted > 0 && deleted > 0) {
-                    // System.out.println("="+a[ia] + "\t="+b[ib]);
                     referenceDiff.add(new Item(DiffItemType.CHANGED, a[ia++]));
                     currentDiff.add(new Item(DiffItemType.CHANGED, b[ib++]));
                 } else if(inserted > 0) {
-                    // System.out.println("\t+" + b[ib]);
                     referenceDiff.add(new Item(DiffItemType.EMPTY, null));
                     currentDiff.add(new Item(DiffItemType.INSERTED, b[ib++]));
                 } else if(deleted > 0) {
-                    // System.out.println("-"+a[ia]);
                     referenceDiff.add(new Item(DiffItemType.DELETED, a[ia++]));
                     currentDiff.add(new Item(DiffItemType.EMPTY, null));
@@ -110,5 +105,4 @@
         }
         while(ia < a.length && ib < b.length) {
-            // System.out.println((ia < a.length ? " "+a[ia]+"\t" : "\t") + (ib < b.length ? " "+b[ib] : ""));
             referenceDiff.add(new Item(DiffItemType.SAME, a[ia++]));
             currentDiff.add(new Item(DiffItemType.SAME, b[ib++]));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 6221)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 6222)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.gui.widgets.JosmComboBox;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -24,5 +25,5 @@
 
     /**
-     * Constructor
+     * Constructs a new {@code ListProjectionChoice}.
      *
      * @param name the display name
@@ -34,9 +35,16 @@
     public ListProjectionChoice(String name, String id, Object[] entries, String label, int defaultIndex) {
         super(name, id);
-        this.entries = entries;
+        this.entries = Utils.copyArray(entries);
         this.label = label;
         this.defaultIndex = defaultIndex;
     }
 
+    /**
+     * Constructs a new {@code ListProjectionChoice}.
+     * @param name the display name
+     * @param id the unique id for this ProjectionChoice
+     * @param entries the list of display entries for the combo-box
+     * @param label a label shown left to the combo-box
+     */
     public ListProjectionChoice(String name, String id, Object[] entries, String label) {
         this(name, id, entries, label, 0);
Index: trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgentResponse.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgentResponse.java	(revision 6221)
+++ trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgentResponse.java	(revision 6222)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.io.auth;
+
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -42,5 +44,5 @@
      */
     public void setPassword(char[] password) {
-        this.password = password;
+        this.password = Utils.copyArray(password);
     }
     /**
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6221)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6222)
@@ -256,4 +256,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 6222
+     */
+    public static char[] copyArray(char[] array) {
+        if (array != null) {
+            return Arrays.copyOf(array, array.length);
+        }
+        return null;
+    }
+    
+    /**
      * Simple file copy function that will overwrite the target file.<br/>
      * Taken from <a href="http://www.rgagnon.com/javadetails/java-0064.html">this article</a> (CC-NC-BY-SA)
@@ -715,4 +728,3 @@
         return all.toString();
     }
-
 }
