Make constant list immutable and uppercase name.
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container.http;
-import com.google.common.collect.Lists;
+import com.google.common.collect.ImmutableList;
import com.yahoo.component.ComponentId;
import com.yahoo.component.ComponentSpecification;
import com.yahoo.vespa.model.container.ContainerCluster;
@@ -9,7 +9,7 @@ import com.yahoo.vespa.model.container.component.FileStatusHandlerComponent;
import com.yahoo.vespa.model.container.component.Handler;
import com.yahoo.vespa.model.container.http.Http.Binding;
-import java.util.ArrayList;
+import java.util.List;
/**
* Helper class for http access control.
@@ -20,7 +20,7 @@ public final class AccessControl {
public static final ComponentId ACCESS_CONTROL_CHAIN_ID = ComponentId.fromString("access-control-chain");
- public static final ArrayList<String> unprotectedHandlers = Lists.newArrayList(
+ private static final List<String> UNPROTECTED_HANDLERS = ImmutableList.of(
FileStatusHandlerComponent.CLASS,
ContainerCluster.APPLICATION_STATUS_HANDLER_CLASS,
ContainerCluster.BINDINGS_OVERVIEW_HANDLER_CLASS,
@@ -29,7 +29,7 @@ public final class AccessControl {
);
public static boolean shouldHandlerBeProtected(Handler<?> handler) {
- return ! unprotectedHandlers.contains(handler.getClassId().getName());
+ return ! UNPROTECTED_HANDLERS.contains(handler.getClassId().getName());
}
public static Binding accessControlBinding(String binding) {
