Wrap ConfigOrigin.comments in unmodifiableList

This prevents people from messing with the returned list.
This commit is contained in:
Havoc Pennington 2014-02-19 11:31:33 -05:00
parent 0f4508cc67
commit e1d59dc48c

View File

@ -221,7 +221,7 @@ final class SimpleConfigOrigin implements ConfigOrigin {
@Override @Override
public List<String> comments() { public List<String> comments() {
if (commentsOrNull != null) { if (commentsOrNull != null) {
return commentsOrNull; return Collections.unmodifiableList(commentsOrNull);
} else { } else {
return Collections.emptyList(); return Collections.emptyList();
} }