Skip to content

Commit 1ee1cd5

Browse files
committed
Replace EMPTY_MAP with type safe Collections.emptyMap()
1 parent 54dff2d commit 1ee1cd5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/java/de/slub/urn/RQF_RFC8141.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import java.util.List;
2323
import java.util.Map;
2424

25-
import static java.util.Collections.EMPTY_MAP;
26-
2725
/**
2826
* Class for representing and parsing optional resolution, query and fragment components
2927
* and making them accessible via unmodifiable maps.
@@ -37,7 +35,7 @@ public final class RQF_RFC8141 {
3735
*
3836
* @see <a href="https://en.wikipedia.org/wiki/Null_object_pattern">Null object pattern</a>
3937
*/
40-
public static final RQF_RFC8141 NULL = new RQF_RFC8141(EMPTY_MAP, EMPTY_MAP, "");
38+
public static final RQF_RFC8141 NULL = new RQF_RFC8141(Collections.emptyMap(), Collections.emptyMap(), "");
4139

4240
private final Map<String, String> resolutionParameters;
4341
private final Map<String, String> queryParameters;

src/test/java/de/slub/urn/RQFRFC8141Test.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ public void NULL_object_is_not_equal_to_null() {
5252

5353
@Test(expected = IllegalArgumentException.class)
5454
public void Passing_null_as_resolutionParameterMap_throws_exception() {
55-
new RQF_RFC8141(null, Collections.EMPTY_MAP, "");
55+
new RQF_RFC8141(null, Collections.emptyMap(), "");
5656
}
5757

5858
@Test(expected = IllegalArgumentException.class)
5959
public void Passing_null_as_queryParameterMap_throws_exception() {
60-
new RQF_RFC8141(Collections.EMPTY_MAP, null, "");
60+
new RQF_RFC8141(Collections.emptyMap(), null, "");
6161
}
6262

6363
@Test(expected = IllegalArgumentException.class)
6464
public void Passing_null_as_fragment_throws_exception() {
65-
new RQF_RFC8141(Collections.EMPTY_MAP, Collections.EMPTY_MAP, null);
65+
new RQF_RFC8141(Collections.emptyMap(), Collections.emptyMap(), null);
6666
}
6767

6868

0 commit comments

Comments
 (0)