diff --git a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java index 5ab288ed3534..7e072a9ac080 100644 --- a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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. @@ -148,11 +148,12 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life void addProtocolResolver(ProtocolResolver resolver); /** - * Load or refresh the persistent representation of the configuration, - * which might an XML file, properties file, or relational database schema. + * Load or refresh the persistent representation of the configuration, which + * might be from Java-based configuration, an XML file, a properties file, a + * relational database schema, or some other format. *
As this is a startup method, it should destroy already created singletons
* if it fails, to avoid dangling resources. In other words, after invocation
- * of that method, either all or no singletons at all should be instantiated.
+ * of this method, either all or no singletons at all should be instantiated.
* @throws BeansException if the bean factory could not be initialized
* @throws IllegalStateException if already initialized and multiple refresh
* attempts are not supported
diff --git a/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java b/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java
index 73b15c22373a..34c4ac5c9ad6 100644
--- a/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java
+++ b/spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -24,7 +24,9 @@
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
-import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.*;
+import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.DEFAULT_VALUE;
+import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.LAZY_INIT_ATTRIBUTE;
+import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.TRUE_VALUE;
/**
* Abstract base class for BeanDefinitionParsers which build
@@ -47,8 +49,9 @@ abstract class AbstractJndiLocatingBeanDefinitionParser extends AbstractSimpleBe
@Override
protected boolean isEligibleAttribute(String attributeName) {
- return (super.isEligibleAttribute(attributeName) && !ENVIRONMENT_REF.equals(attributeName) && !LAZY_INIT_ATTRIBUTE
- .equals(attributeName));
+ return (super.isEligibleAttribute(attributeName) &&
+ !ENVIRONMENT_REF.equals(attributeName) &&
+ !LAZY_INIT_ATTRIBUTE.equals(attributeName));
}
@Override
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java
index 431a194cbfa9..e89c8dea1a85 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -43,12 +43,11 @@
*/
public class GenericCallMetaDataProvider implements CallMetaDataProvider {
- /** Logger available to subclasses */
+ /** Logger available to subclasses. */
protected static final Log logger = LogFactory.getLog(CallMetaDataProvider.class);
- private boolean procedureColumnMetaDataUsed = false;
- private String userName;
+ private final String userName;
private boolean supportsCatalogsInProcedureCalls = true;
@@ -58,7 +57,9 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
private boolean storesLowerCaseIdentifiers = false;
- private List By default all headers are allowed.
*/
public CorsRegistration allowedHeaders(String... headers) {
- this.config.setAllowedHeaders(new ArrayList<>(Arrays.asList(headers)));
+ this.config.setAllowedHeaders(Arrays.asList(headers));
return this;
}
@@ -96,7 +97,7 @@ public CorsRegistration allowedHeaders(String... headers) {
* By default this is not set.
*/
public CorsRegistration exposedHeaders(String... headers) {
- this.config.setExposedHeaders(new ArrayList<>(Arrays.asList(headers)));
+ this.config.setExposedHeaders(Arrays.asList(headers));
return this;
}
diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistry.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistry.java
index fb68a1280dd5..263e66c15ee9 100644
--- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistry.java
+++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -37,18 +37,12 @@ public class CorsRegistry {
/**
- * Enable cross origin request handling for the specified path pattern.
- *
+ * Enable cross-origin request handling for the specified path pattern.
* Exact path mapping URIs (such as {@code "/admin"}) are supported as
* well as Ant-style path patterns (such as {@code "/admin/**"}).
- *
- * The following defaults are applied to the {@link CorsRegistration}:
- * By default, the {@code CorsConfiguration} for this mapping is
+ * initialized with default values as described in
+ * {@link CorsConfiguration#applyPermitDefaultValues()}.
*/
public CorsRegistration addMapping(String pathPattern) {
CorsRegistration registration = new CorsRegistration(pathPattern);
@@ -56,6 +50,10 @@ public CorsRegistration addMapping(String pathPattern) {
return registration;
}
+ /**
+ * Return the registered {@link CorsConfiguration} objects,
+ * keyed by path pattern.
+ */
protected Map By default "simple" methods, i.e. {@code GET}, {@code HEAD}, and
- * {@code POST} are allowed.
+ * The special value {@code "*"} allows all methods.
+ * By default "simple" methods {@code GET}, {@code HEAD}, and {@code POST}
+ * are allowed.
*/
public CorsRegistration allowedMethods(String... methods) {
this.config.setAllowedMethods(Arrays.asList(methods));
@@ -77,9 +77,9 @@ public CorsRegistration allowedMethods(String... methods) {
}
/**
- * Set the list of headers that a preflight request can list as allowed
- * for use during an actual request. The special value {@code "*"} may be
- * used to allow all headers.
+ * Set the list of headers that a pre-flight request can list as allowed
+ * for use during an actual request.
+ * The special value {@code "*"} may be used to allow all headers.
* A header name is not required to be listed if it is one of:
* {@code Cache-Control}, {@code Content-Language}, {@code Expires},
* {@code Last-Modified}, or {@code Pragma} as per the CORS spec.
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistry.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistry.java
index da99c0b5b424..ad93c973ac95 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistry.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -39,20 +39,11 @@ public class CorsRegistry {
/**
* Enable cross-origin request handling for the specified path pattern.
- *
* Exact path mapping URIs (such as {@code "/admin"}) are supported as
* well as Ant-style path patterns (such as {@code "/admin/**"}).
- * By default, all origins, all headers, credentials and {@code GET},
- * {@code HEAD}, and {@code POST} methods are allowed, and the max age
- * is set to 30 minutes.
- *
- * The following defaults are applied to the {@link CorsRegistration}:
- * By default, the {@code CorsConfiguration} for this mapping is
+ * initialized with default values as described in
+ * {@link CorsConfiguration#applyPermitDefaultValues()}.
*/
public CorsRegistration addMapping(String pathPattern) {
CorsRegistration registration = new CorsRegistration(pathPattern);
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java
index fede5f182e2d..3c0ee7ce0a12 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -151,7 +151,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
private List
- *
+ *
- *
+ *