Skip to content

Commit

Permalink
Use unmodifiableSet for JsonMap
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Jun 27, 2024
1 parent 8f4b086 commit 633e658
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package net.javacrumbs.jsonunit.core.internal;

import static java.util.stream.Collectors.toUnmodifiableSet;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.prettyPrint;

import java.math.BigDecimal;
Expand All @@ -24,7 +25,6 @@
import java.util.LinkedList;
import java.util.Set;
import java.util.Spliterators;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -236,7 +236,7 @@ public Set<Entry<String, Object>> entrySet() {
entrySet = StreamSupport.stream(Spliterators.spliteratorUnknownSize(fields, 0), false)
.map(keyValue -> new SimpleEntry<>(
keyValue.getKey(), keyValue.getValue().getValue()))
.collect(Collectors.toSet());
.collect(toUnmodifiableSet());
}
return entrySet;
}
Expand Down

0 comments on commit 633e658

Please sign in to comment.