diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java index bf2b838f63..98b3d60199 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -85,9 +85,9 @@ import org.springframework.util.StringUtils; * another using the {@link Import} annotation). * *
This class helps separate the concern of parsing the structure of a Configuration - * class from the concern of registering BeanDefinition objects based on the - * content of that model (with the exception of {@code @ComponentScan} annotations which - * need to be registered immediately). + * class from the concern of registering BeanDefinition objects based on the content of + * that model (with the exception of {@code @ComponentScan} annotations which need to be + * registered immediately). * *
This ASM-based implementation avoids reflection and eager class loading in order to
* interoperate effectively with lazy class loading in a Spring ApplicationContext.
@@ -814,7 +814,7 @@ class ConfigurationClassParser {
return new AssignableTypeFilter(clazz).match((MetadataReader) this.source, metadataReaderFactory);
}
- public ConfigurationClass asConfigClass(ConfigurationClass importedBy) throws IOException {
+ public ConfigurationClass asConfigClass(ConfigurationClass importedBy) {
if (this.source instanceof Class) {
return new ConfigurationClass((Class>) this.source, importedBy);
}
@@ -882,7 +882,7 @@ class ConfigurationClassParser {
return result;
}
- public Set If this method returns {@code true} for a given listener as a first pass,
* the listener instance will get retrieved and fully evaluated through a
- * {@link #supportsEvent(ApplicationListener,ResolvableType, Class)} call afterwards.
+ * {@link #supportsEvent(ApplicationListener, ResolvableType, Class)} call afterwards.
* @param listenerType the listener's type as determined by the BeanFactory
* @param eventType the event type to check
* @return whether the given listener should be included in the candidates
diff --git a/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
index d63035c747..63752a17da 100644
--- a/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
+++ b/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
@@ -1214,7 +1214,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
@Override
public A findAnnotationOnBean(String beanName, Class annotationType)
- throws NoSuchBeanDefinitionException{
+ throws NoSuchBeanDefinitionException {
assertBeanFactoryActive();
return getBeanFactory().findAnnotationOnBean(beanName, annotationType);
diff --git a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
index 48250948b0..f6710d4491 100644
--- a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
+++ b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -292,7 +292,7 @@ public class ResourceBundleMessageSource extends AbstractResourceBasedMessageSou
try {
return bundle.getString(key);
}
- catch (MissingResourceException ex){
+ catch (MissingResourceException ex) {
// Assume key not found for some other reason
// -> do NOT throw the exception to allow for checking parent message source.
}
diff --git a/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java b/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java
index 9dbd8a653c..e9989a3838 100644
--- a/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java
+++ b/spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -35,14 +35,13 @@ import org.springframework.core.NamedThreadLocal;
* or through a {@link org.springframework.beans.factory.config.CustomScopeConfigurer} bean.
*
* {@code SimpleThreadScope} does not clean up any objects associated with it.
- * As such, it is typically preferable to use
- * {@link org.springframework.web.context.request.RequestScope RequestScope}
- * in web environments.
+ * It is therefore typically preferable to use a request-bound scope implementation such
+ * as {@code org.springframework.web.context.request.RequestScope} in web environments,
+ * implementing the full lifecycle for scoped attributes (including reliable destruction).
*
- * For an implementation of a thread-based {@code Scope} with support for
- * destruction callbacks, refer to the
- *
-* Spring by Example Custom Thread Scope Module.
+ * For an implementation of a thread-based {@code Scope} with support for destruction
+ * callbacks, refer to
+ * Spring by Example.
*
* Thanks to Eugene Kuleshov for submitting the original prototype for a thread scope!
*
diff --git a/spring-core/src/main/java/org/springframework/util/ClassUtils.java b/spring-core/src/main/java/org/springframework/util/ClassUtils.java
index 0b161158e9..35e08a462f 100644
--- a/spring-core/src/main/java/org/springframework/util/ClassUtils.java
+++ b/spring-core/src/main/java/org/springframework/util/ClassUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -34,7 +34,7 @@ import java.util.Map;
import java.util.Set;
/**
- * Miscellaneous class utility methods.
+ * Miscellaneous {@code java.lang.Class} utility methods.
* Mainly for internal use within the framework.
*
* @author Juergen Hoeller
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompSession.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompSession.java
index bc358a924d..8851a394e6 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompSession.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompSession.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -17,8 +17,8 @@
package org.springframework.messaging.simp.stomp;
/**
- * Represents a STOMP session with operations to send messages, create
- * subscriptions and receive messages on those subscriptions.
+ * Represents a STOMP session with operations to send messages,
+ * create subscriptions and receive messages on those subscriptions.
*
* @author Rossen Stoyanchev
* @since 4.2
@@ -37,10 +37,10 @@ public interface StompSession {
/**
* When enabled, a receipt header is automatically added to future
- * {@code send} and {@code subscribe} operations on this session, which causes
- * the server to return a RECEIPT. An application can then use the
- * {@link StompSession.Receiptable
- * Receiptable} returned from the operation to track the receipt.
+ * {@code send} and {@code subscribe} operations on this session, which
+ * causes the server to return a RECEIPT. An application can then use
+ * the {@link StompSession.Receiptable Receiptable} returned from the
+ * operation to track the receipt.
* A receipt header can also be added manually through the overloaded
* methods that accept {@code StompHeaders}.
*/
@@ -57,11 +57,11 @@ public interface StompSession {
Receiptable send(String destination, Object payload);
/**
- * An overloaded version of {@link #send(String, Object)} that accepts
- * full {@link StompHeaders} instead of a destination. The headers must
+ * An overloaded version of {@link #send(String, Object)} with full
+ * {@link StompHeaders} instead of just a destination. The headers must
* contain a destination and may also have other headers such as
- * "content-type" or custom headers for the broker to propagate to subscribers,
- * or broker-specific, non-standard headers..
+ * "content-type" or custom headers for the broker to propagate to
+ * subscribers, or broker-specific, non-standard headers.
* @param headers the message headers
* @param payload the message payload
* @return a Receiptable for tracking receipts
@@ -79,7 +79,7 @@ public interface StompSession {
/**
* An overloaded version of {@link #subscribe(String, StompFrameHandler)}
- * that accepts full {@link StompHeaders} rather instead of a destination.
+ * with full {@link StompHeaders} instead of just a destination.
* @param headers the headers for the subscribe message frame
* @param handler the handler for received messages
* @return a handle to use to unsubscribe and/or track receipts
diff --git a/spring-web/src/main/java/org/springframework/http/HttpHeaders.java b/spring-web/src/main/java/org/springframework/http/HttpHeaders.java
index 690b276306..2507b2180e 100644
--- a/spring-web/src/main/java/org/springframework/http/HttpHeaders.java
+++ b/spring-web/src/main/java/org/springframework/http/HttpHeaders.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -1315,7 +1315,7 @@ public class HttpHeaders implements MultiValueMap Looks for the most exact pattern, where most exact is defined as
* the longest path pattern.
- * @param urlPath URL the bean is mapped to
+ * @param urlPath the URL the bean is mapped to
* @param request current HTTP request (to expose the path within the mapping to)
* @return the associated handler instance, or {@code null} if not found
* @see #exposePathWithinMapping
@@ -179,7 +179,7 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping i
}
else if (useTrailingSlashMatch()) {
if (!registeredPattern.endsWith("/") && getPathMatcher().match(registeredPattern + "/", urlPath)) {
- matchingPatterns.add(registeredPattern +"/");
+ matchingPatterns.add(registeredPattern + "/");
}
}
}
@@ -271,7 +271,9 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping i
* @param request the request to expose the path to
* @see #PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
*/
- protected void exposePathWithinMapping(String bestMatchingPattern, String pathWithinMapping, HttpServletRequest request) {
+ protected void exposePathWithinMapping(String bestMatchingPattern, String pathWithinMapping,
+ HttpServletRequest request) {
+
request.setAttribute(BEST_MATCHING_PATTERN_ATTRIBUTE, bestMatchingPattern);
request.setAttribute(PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, pathWithinMapping);
}
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java
index 238ad76527..dcf1125ef2 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerExceptionResolverComposite.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -65,11 +65,11 @@ public class HandlerExceptionResolverComposite implements HandlerExceptionResolv
/**
* Resolve the exception by iterating over the list of configured exception resolvers.
- * The first one to return a ModelAndView instance wins. Otherwise {@code null} is returned.
+ * The first one to return a {@link ModelAndView} wins. Otherwise {@code null} is returned.
*/
@Override
- public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response,
- Object handler,Exception ex) {
+ public ModelAndView resolveException(
+ HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
if (this.resolvers != null) {
for (HandlerExceptionResolver handlerExceptionResolver : this.resolvers) {
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java
index 43f5b49614..d800d0c9ab 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2015 the original author or authors.
+ * Copyright 2002-2019 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.
@@ -179,8 +179,8 @@ public final class PatternsRequestCondition extends AbstractRequestCondition A String return value can be interpreted in more than one ways depending
- * on the presence of annotations like {@code @ModelAttribute} or
- * {@code @ResponseBody}. Therefore this handler should be configured after
- * the handlers that support these annotations.
+ * A String return value can be interpreted in more than one ways depending on
+ * the presence of annotations like {@code @ModelAttribute} or {@code @ResponseBody}.
+ * Therefore this handler should be configured after the handlers that support these
+ * annotations.
*
* @author Rossen Stoyanchev
* @author Juergen Hoeller
@@ -47,12 +47,10 @@ public class ViewNameMethodReturnValueHandler implements HandlerMethodReturnValu
/**
- * Configure one more simple patterns (as described in
- * {@link PatternMatchUtils#simpleMatch}) to use in order to recognize
- * custom redirect prefixes in addition to "redirect:".
- * Note that simply configuring this property will not make a custom
- * redirect prefix work. There must be a custom View that recognizes the
- * prefix as well.
+ * Configure one more simple patterns (as described in {@link PatternMatchUtils#simpleMatch})
+ * to use in order to recognize custom redirect prefixes in addition to "redirect:".
+ * Note that simply configuring this property will not make a custom redirect prefix work.
+ * There must be a custom View that recognizes the prefix as well.
* @since 4.1
*/
public void setRedirectPatterns(String... redirectPatterns) {
@@ -84,7 +82,7 @@ public class ViewNameMethodReturnValueHandler implements HandlerMethodReturnValu
mavContainer.setRedirectModelScenario(true);
}
}
- else if (returnValue != null){
+ else if (returnValue != null) {
// should not happen
throw new UnsupportedOperationException("Unexpected return type: " +
returnType.getParameterType().getName() + " in method: " + returnType.getMethod());