关于static静态块的使用和static list的使用

public class CorsConfiguration {

/**
* Wildcard representing <em>all</em> origins, methods, or headers.
*/
public static final String ALL = "*";

private static final List<HttpMethod> DEFAULT_METHODS;

static {
List<HttpMethod> rawMethods = new ArrayList<HttpMethod>(2);
rawMethods.add(HttpMethod.GET);
rawMethods.add(HttpMethod.HEAD);
DEFAULT_METHODS = Collections.unmodifiableList(rawMethods);
}

原文地址:https://www.cnblogs.com/panxuejun/p/7274939.html