diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-12 08:30:35 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-12 08:39:04 +0200 |
commit | 76a89b62274060452022ddf24a7685ee2f380cb4 (patch) | |
tree | ef924603de22efd026f519ab31fd8f5a6ff60f2f /config-model-api | |
parent | 7e7ebf7b527be1f163d497a41898e2252d878fe7 (diff) |
Replace all usages of Arrays.asList with List.of where possible.
Diffstat (limited to 'config-model-api')
3 files changed, 12 insertions, 12 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/Notifications.java b/config-model-api/src/main/java/com/yahoo/config/application/api/Notifications.java index ac8900ab67b..08fb4d75183 100644 --- a/config-model-api/src/main/java/com/yahoo/config/application/api/Notifications.java +++ b/config-model-api/src/main/java/com/yahoo/config/application/api/Notifications.java @@ -4,7 +4,6 @@ package com.yahoo.config.application.api; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Objects; @@ -107,7 +106,7 @@ public class Notifications { private final List<When> includes; When(When... includes) { - this.includes = Arrays.asList(includes); + this.includes = List.of(includes); } public static String toValue(When when) { diff --git a/config-model-api/src/test/java/com/yahoo/config/model/api/HostInfoTest.java b/config-model-api/src/test/java/com/yahoo/config/model/api/HostInfoTest.java index 6bd94d0aa74..7e4b0a07952 100644 --- a/config-model-api/src/test/java/com/yahoo/config/model/api/HostInfoTest.java +++ b/config-model-api/src/test/java/com/yahoo/config/model/api/HostInfoTest.java @@ -2,7 +2,8 @@ package com.yahoo.config.model.api; import org.junit.Test; -import java.util.Arrays; + +import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -10,10 +11,10 @@ import static org.junit.Assert.assertNotEquals; public class HostInfoTest { @Test public void testEquals() { - HostInfo a = new HostInfo("foo.yahoo.com", Arrays.asList(new ServiceInfo("foo", "bar", null, null, "config-id", "host-name"))); - HostInfo b = new HostInfo("foo.yahoo.com", Arrays.asList(new ServiceInfo("foo", "bar", null, null, "config-id", "host-name"))); - HostInfo c = new HostInfo("foo.yahoo.com", Arrays.asList(new ServiceInfo("foo", "baz", null, null, "config-id", "host-name"))); - HostInfo d = new HostInfo("foo.yahoo.com", Arrays.asList(new ServiceInfo("bar", "baz", null, null, "config-id", "host-name"))); + HostInfo a = new HostInfo("foo.yahoo.com", List.of(new ServiceInfo("foo", "bar", null, null, "config-id", "host-name"))); + HostInfo b = new HostInfo("foo.yahoo.com", List.of(new ServiceInfo("foo", "bar", null, null, "config-id", "host-name"))); + HostInfo c = new HostInfo("foo.yahoo.com", List.of(new ServiceInfo("foo", "baz", null, null, "config-id", "host-name"))); + HostInfo d = new HostInfo("foo.yahoo.com", List.of(new ServiceInfo("bar", "baz", null, null, "config-id", "host-name"))); HostInfo e = new HostInfo("bar.yahoo.com", null); assertEquals(a, b); assertNotEquals(a, c); diff --git a/config-model-api/src/test/java/com/yahoo/config/model/api/PortInfoTest.java b/config-model-api/src/test/java/com/yahoo/config/model/api/PortInfoTest.java index 08e00e5c771..3ee9217e67f 100644 --- a/config-model-api/src/test/java/com/yahoo/config/model/api/PortInfoTest.java +++ b/config-model-api/src/test/java/com/yahoo/config/model/api/PortInfoTest.java @@ -3,7 +3,7 @@ package com.yahoo.config.model.api; import org.junit.Test; -import java.util.Arrays; +import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -11,10 +11,10 @@ import static org.junit.Assert.assertNotEquals; public class PortInfoTest { @Test public void testEquals() { - PortInfo a = new PortInfo(1234, Arrays.asList("foo")); - PortInfo b = new PortInfo(1234, Arrays.asList("foo")); - PortInfo c = new PortInfo(1234, Arrays.asList("foo", "bar")); - PortInfo d = new PortInfo(12345, Arrays.asList("foo")); + PortInfo a = new PortInfo(1234, List.of("foo")); + PortInfo b = new PortInfo(1234, List.of("foo")); + PortInfo c = new PortInfo(1234, List.of("foo", "bar")); + PortInfo d = new PortInfo(12345, List.of("foo")); assertEquals(a, b); assertNotEquals(a, c); assertNotEquals(a, d); |