summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbjormel <bjormel@verizonmedia.com>2021-08-16 13:26:34 +0200
committerbjormel <bjormel@verizonmedia.com>2021-08-16 13:26:34 +0200
commit8dffb0ecdde3188a43a66110ebc5ffb0b3af2aad (patch)
tree68ea67a5482cfe3b28c09c21236b144d9a19b4c3
parent7188c50f25d8f33503fa1186a13b919c7257431a (diff)
Initialize HasMap with Map.of
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainer.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainer.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainer.java
index e5fae90c8aa..c4c01f74e26 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainer.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/AclMaintainer.java
@@ -56,11 +56,9 @@ public class AclMaintainer {
this.containerOperations = containerOperations;
this.ipAddresses = ipAddresses;
this.metrics = metrics;
- this.lastSuccess = new HashMap<>(){{
- put(IPVersion.IPv4.id(), System.currentTimeMillis());
- put(IPVersion.IPv6.id(), System.currentTimeMillis());
- }};
-
+ var now = System.currentTimeMillis();
+ this.lastSuccess = new HashMap<>(Map.of(IPVersion.IPv4.id(), now,
+ IPVersion.IPv6.id(), now));
}
// ip(6)tables operate while having the xtables lock, run with synchronized to prevent multiple NodeAgents