diff --git a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java index d5fd77867c..f3041f62e9 100644 --- a/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java +++ b/spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java @@ -777,4 +777,5 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker return (this.cacheOperation.hashCode() * 31 + this.methodCacheKey.hashCode()); } } + } diff --git a/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java b/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java index 97fc7a5dc1..8f7f88a9c2 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java +++ b/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -27,7 +27,7 @@ import org.springframework.util.ObjectUtils; * * @author Costin Leau * @author Stephane Nicoll - * @since 4.2.0 + * @since 4.2 * @see CachedExpressionEvaluator */ public final class AnnotatedElementKey { @@ -36,12 +36,13 @@ public final class AnnotatedElementKey { private final Class> targetClass; + /** * Create a new instance with the specified {@link AnnotatedElement} and * optional target {@link Class}. */ public AnnotatedElementKey(AnnotatedElement element, Class> targetClass) { - Assert.notNull(element, "AnnotatedElement must be set."); + Assert.notNull(element, "AnnotatedElement must not be null"); this.element = element; this.targetClass = targetClass; } diff --git a/spring-context/src/main/java/org/springframework/context/expression/CachedExpressionEvaluator.java b/spring-context/src/main/java/org/springframework/context/expression/CachedExpressionEvaluator.java index 81d0c55dc8..4bb20b2894 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/CachedExpressionEvaluator.java +++ b/spring-context/src/main/java/org/springframework/context/expression/CachedExpressionEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -28,13 +28,14 @@ import org.springframework.util.ObjectUtils; * are defined on {@link java.lang.reflect.AnnotatedElement}. * * @author Stephane Nicoll - * @since 4.2.0 + * @since 4.2 * @see AnnotatedElementKey */ public abstract class CachedExpressionEvaluator { private final SpelExpressionParser parser; + /** * Create a new instance with the specified {@link SpelExpressionParser}. */ @@ -50,6 +51,7 @@ public abstract class CachedExpressionEvaluator { this(new SpelExpressionParser()); } + /** * Return the {@link SpelExpressionParser} to use. */ @@ -57,6 +59,7 @@ public abstract class CachedExpressionEvaluator { return this.parser; } + /** * Return the {@link Expression} for the specified SpEL value *
Parse the expression if it hasn't been already.
@@ -66,6 +69,7 @@ public abstract class CachedExpressionEvaluator {
*/
protected Expression getExpression(Map
- * Expose the actual method arguments using the following aliases:
+ *
+ * Expose the actual method arguments using the following aliases:
* Use {@link MockMvcResultMatchers#jsonPath(String, Object...)} or
@@ -65,7 +66,7 @@ public class JsonPathResultMatchers {
* Use this method if the JSON payloads are prefixed to avoid
* Cross Site Script Inclusion (XSSI) attacks.
* @param prefix the string prefix prepended to the actual JSON payload
- * @since 4.3.0
+ * @since 4.3
*/
public JsonPathResultMatchers prefix(String prefix) {
this.prefix = prefix;
@@ -252,14 +253,14 @@ public class JsonPathResultMatchers {
String content = result.getResponse().getContentAsString();
if (StringUtils.hasLength(this.prefix)) {
try {
- String reason = String.format("Expected a JSON payload prefixed with \"%s\" but found: %s", this.prefix,
- StringUtils.quote(content.substring(0, this.prefix.length())));
+ String reason = String.format("Expected a JSON payload prefixed with \"%s\" but found: %s",
+ this.prefix, StringUtils.quote(content.substring(0, this.prefix.length())));
MatcherAssert.assertThat(reason, content, StringStartsWith.startsWith(this.prefix));
return content.substring(this.prefix.length());
}
catch (StringIndexOutOfBoundsException oobe) {
- String message = "JSON prefix \"" + this.prefix + "\" not found, exception: ";
- throw new AssertionError(message + oobe.getMessage());
+ throw new AssertionError(
+ "JSON prefix \"" + this.prefix + "\" not found, exception: " + oobe.getMessage());
}
}
else {
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java
index 647b6ecdd9..0be4cb9bc2 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java
@@ -71,14 +71,11 @@ import org.springframework.web.util.WebUtils;
*
* @author Rossen Stoyanchev
* @since 3.2
- *
* @see #handleException(Exception, WebRequest)
* @see org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver
*/
public abstract class ResponseEntityExceptionHandler {
- protected final Log logger = LogFactory.getLog(getClass());
-
/**
* Log category to use when no mapped handler is found for a request.
* @see #pageNotFoundLogger
@@ -86,11 +83,16 @@ public abstract class ResponseEntityExceptionHandler {
public static final String PAGE_NOT_FOUND_LOG_CATEGORY = "org.springframework.web.servlet.PageNotFound";
/**
- * Additional logger to use when no mapped handler is found for a request.
+ * Specific logger to use when no mapped handler is found for a request.
* @see #PAGE_NOT_FOUND_LOG_CATEGORY
*/
protected static final Log pageNotFoundLogger = LogFactory.getLog(PAGE_NOT_FOUND_LOG_CATEGORY);
+ /**
+ * Common logger for use in subclasses.
+ */
+ protected final Log logger = LogFactory.getLog(getClass());
+
/**
* Provides handling for standard Spring MVC exceptions.
@@ -115,9 +117,7 @@ public abstract class ResponseEntityExceptionHandler {
NoHandlerFoundException.class
})
public final ResponseEntity
*
*
* @author Stephane Nicoll
- * @since 4.2.0
+ * @since 4.2
*/
public class MethodBasedEvaluationContext extends StandardEvaluationContext {
@@ -46,6 +46,7 @@ public class MethodBasedEvaluationContext extends StandardEvaluationContext {
private boolean paramLoaded = false;
+
public MethodBasedEvaluationContext(Object rootObject, Method method, Object[] args,
ParameterNameDiscoverer paramDiscoverer) {
@@ -55,6 +56,7 @@ public class MethodBasedEvaluationContext extends StandardEvaluationContext {
this.paramDiscoverer = paramDiscoverer;
}
+
@Override
public Object lookupVariable(String name) {
Object variable = super.lookupVariable(name);
diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/result/JsonPathResultMatchers.java b/spring-test/src/main/java/org/springframework/test/web/servlet/result/JsonPathResultMatchers.java
index f2ef059a95..f572a372bf 100644
--- a/spring-test/src/main/java/org/springframework/test/web/servlet/result/JsonPathResultMatchers.java
+++ b/spring-test/src/main/java/org/springframework/test/web/servlet/result/JsonPathResultMatchers.java
@@ -47,6 +47,7 @@ public class JsonPathResultMatchers {
private String prefix;
+
/**
* Protected constructor.
*