mirror of
https://github.com/lightbend/config.git
synced 2025-02-22 17:20:34 +08:00
Wrap ConfigOrigin.comments in unmodifiableList
This prevents people from messing with the returned list.
This commit is contained in:
parent
0f4508cc67
commit
e1d59dc48c
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user