Polish AbstractExposableEndpoint

pull/31663/head
Moritz Halbritter 2 years ago
parent 96c0e4783b
commit d58f33f1ce

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,9 +16,7 @@
package org.springframework.boot.actuate.endpoint;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.util.Assert;
@ -34,9 +32,9 @@ public abstract class AbstractExposableEndpoint<O extends Operation> implements
private final EndpointId id;
private boolean enabledByDefault;
private final boolean enabledByDefault;
private List<O> operations;
private final List<O> operations;
/**
* Create a new {@link AbstractExposableEndpoint} instance.
@ -49,7 +47,7 @@ public abstract class AbstractExposableEndpoint<O extends Operation> implements
Assert.notNull(operations, "Operations must not be null");
this.id = id;
this.enabledByDefault = enabledByDefault;
this.operations = Collections.unmodifiableList(new ArrayList<>(operations));
this.operations = List.copyOf(operations);
}
@Override

Loading…
Cancel
Save