The following alters the parameter chr and ends up matching the "swapped" 2D array. I can't see how it can change as it is not on the receiving end of any calculation. There are also similar variables from where this method is called from which are also changed in a similar manner.
private Character[][] moveLeft(Character[][] chr) {
Character[][] swapped = chr;
int[] pos = getBlankLocation(chr); //find the blank space
//location of blank space in 2d array
int row = pos[0];
int col = pos[1];
if (col != 0) {
Character temp = chr[row][col - 1];
swapped[row][col - 1] = chr[row][col];
swapped[row][col] = temp;
return swappedChr;
}
return null;
}