diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java index 0eef2b1a56d4438ecc120ca2ff64399a9699b4d4..5f4429303045b086f14b642c20c08e40a581312b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -203,8 +203,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut pointcutParameters[i] = parser.createPointcutParameter( this.pointcutParameterNames[i], this.pointcutParameterTypes[i]); } - return parser.parsePointcutExpression( - replaceBooleanOperators(getExpression()), + return parser.parsePointcutExpression(replaceBooleanOperators(getExpression()), this.pointcutDeclarationScope, pointcutParameters); } diff --git a/spring-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java b/spring-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java index ae0b4f5fb160e886a2e7b633e29ff1673519d574..965fc4723333a28fe859a4220c9050ad86eccf83 100644 --- a/spring-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java +++ b/spring-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java @@ -38,6 +38,7 @@ public class GenericApplicationListenerAdapter implements GenericApplicationList private final ResolvableType declaredEventType; + /** * Create a new GenericApplicationListener for the given delegate. * @param delegate the delegate listener to be invoked @@ -87,6 +88,7 @@ public class GenericApplicationListenerAdapter implements GenericApplicationList return (this.delegate instanceof Ordered ? ((Ordered) this.delegate).getOrder() : Ordered.LOWEST_PRECEDENCE); } + static ResolvableType resolveDeclaredEventType(Class listenerType) { ResolvableType resolvableType = ResolvableType.forClass(listenerType).as(ApplicationListener.class); if (resolvableType == null || !resolvableType.hasGenerics()) { diff --git a/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java b/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java index 94c48448f5b8b635bfd7c946adcfd24e8f5b8b33..dc5df2c80d36dd2e5f80ef1fbf5bf33873e3e071 100644 --- a/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -67,12 +67,12 @@ public class GenericTypeResolverTests { @Test public void methodReturnTypes() { assertEquals(Integer.class, - resolveReturnTypeArgument(findMethod(MyTypeWithMethods.class, "integer"), MyInterfaceType.class)); + resolveReturnTypeArgument(findMethod(MyTypeWithMethods.class, "integer"), MyInterfaceType.class)); assertEquals(String.class, - resolveReturnTypeArgument(findMethod(MyTypeWithMethods.class, "string"), MyInterfaceType.class)); + resolveReturnTypeArgument(findMethod(MyTypeWithMethods.class, "string"), MyInterfaceType.class)); assertEquals(null, resolveReturnTypeArgument(findMethod(MyTypeWithMethods.class, "raw"), MyInterfaceType.class)); assertEquals(null, - resolveReturnTypeArgument(findMethod(MyTypeWithMethods.class, "object"), MyInterfaceType.class)); + resolveReturnTypeArgument(findMethod(MyTypeWithMethods.class, "object"), MyInterfaceType.class)); } @Test @@ -81,13 +81,13 @@ public class GenericTypeResolverTests { Method intMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerInputMessage", MyInterfaceType.class); MethodParameter intMessageMethodParam = new MethodParameter(intMessageMethod, 0); assertEquals(MyInterfaceType.class, - resolveType(intMessageMethodParam.getGenericParameterType(), new HashMap())); + resolveType(intMessageMethodParam.getGenericParameterType(), new HashMap())); Method intArrMessageMethod = findMethod(MyTypeWithMethods.class, "readIntegerArrayInputMessage", - MyInterfaceType[].class); + MyInterfaceType[].class); MethodParameter intArrMessageMethodParam = new MethodParameter(intArrMessageMethod, 0); assertEquals(MyInterfaceType[].class, - resolveType(intArrMessageMethodParam.getGenericParameterType(), new HashMap())); + resolveType(intArrMessageMethodParam.getGenericParameterType(), new HashMap())); Method genericArrMessageMethod = findMethod(MySimpleTypeWithMethods.class, "readGenericArrayInputMessage", Object[].class); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java index b6df9f9016d7a4074c9588808511a4ceae037d92..d6d5ca8b0bedd70a97762ec5e85f0c513e27b462 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/NoHandlerFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -13,20 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.web.servlet; import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.springframework.http.HttpHeaders; /** * Exception to be thrown if DispatcherServlet is unable to determine a corresponding - * handler for an incoming HTTP request. The DispatcherServlet throws this exception only - * if its throwExceptionIfNoHandlerFound property is set to "true". + * handler for an incoming HTTP request. The DispatcherServlet throws this exception + * only if its "throwExceptionIfNoHandlerFound" property is set to "true". * * @author Brian Clozel * @since 4.0 - * @see org.springframework.web.servlet.DispatcherServlet + * @see DispatcherServlet#setThrowExceptionIfNoHandlerFound(boolean) + * @see DispatcherServlet#noHandlerFound(HttpServletRequest, HttpServletResponse) */ @SuppressWarnings("serial") public class NoHandlerFoundException extends ServletException { @@ -51,6 +55,7 @@ public class NoHandlerFoundException extends ServletException { this.headers = headers; } + public String getHttpMethod() { return this.httpMethod; }