Make an unmodifiable copy of the list with current file paths

The list with the current file paths that is stored in ChangeData
should not be modified. To protect against modifications it is made
unmodifiable and when setting the list a defensive copy of the passed
list is done so that changes to the passed list after the fact do not
impact the list stored in ChangeData.

Change-Id: I396d63fc13caf6925aaab4fa5dd76fc7ba9816e6
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Shawn Pearce
2013-10-08 10:10:03 -07:00
parent 4703ee93fc
commit fd4e3b1156

View File

@@ -189,7 +189,7 @@ public class ChangeData {
}
public void setCurrentFilePaths(List<String> filePaths) {
currentFiles = filePaths;
currentFiles = ImmutableList.copyOf(filePaths);
}
public List<String> currentFilePaths(Provider<ReviewDb> db,