diff --git a/spring-orm/src/main/java/org/springframework/orm/hibernate3/support/IdTransferringMergeEventListener.java b/spring-orm/src/main/java/org/springframework/orm/hibernate3/support/IdTransferringMergeEventListener.java index c83b5e0501..c87e46c5b3 100644 --- a/spring-orm/src/main/java/org/springframework/orm/hibernate3/support/IdTransferringMergeEventListener.java +++ b/spring-orm/src/main/java/org/springframework/orm/hibernate3/support/IdTransferringMergeEventListener.java @@ -49,7 +49,7 @@ import org.hibernate.persister.entity.EntityPersister; * @since 1.2 * @see org.springframework.orm.hibernate3.LocalSessionFactoryBean#setEventListeners(java.util.Map) */ -@SuppressWarnings({ "serial", "rawtypes", "deprecation" }) +@SuppressWarnings({"serial", "rawtypes", "deprecation"}) public class IdTransferringMergeEventListener extends DefaultMergeEventListener { /** diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java index 6ec21b5d3d..0103488828 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 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. @@ -74,9 +74,11 @@ import org.springframework.web.servlet.View; */ public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExceptionResolver { - // dummy method placeholder - private static final Method NO_METHOD_FOUND = - ClassUtils.getMethodIfAvailable(System.class, "currentTimeMillis", (Class[]) null); + /** + * Arbitrary {@link Method} reference, indicating no method found in the cache. + */ + private static final Method NO_METHOD_FOUND = ClassUtils.getMethodIfAvailable(System.class, "currentTimeMillis"); + private final Map, Map, Method>> exceptionHandlerCache = new ConcurrentHashMap, Map, Method>>(64); @@ -209,7 +211,7 @@ public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExc /** * Uses the {@link ExceptionDepthComparator} to find the best matching method. - * @return the best matching method or {@code null}. + * @return the best matching method, or {@code null} if none found */ private Method getBestMatchingMethod( Map, Method> resolverMethods, Exception thrownException) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java index 18e02fe063..49c6ea90ad 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 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. @@ -80,15 +80,17 @@ import org.springframework.web.servlet.support.RequestContextUtils; * @author Arjen Poutsma * @author Juergen Hoeller * @since 3.0 - * * @deprecated as of Spring 3.2, in favor of * {@link org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver ExceptionHandlerExceptionResolver} */ @Deprecated public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExceptionResolver { - // dummy method placeholder - private static final Method NO_METHOD_FOUND = ClassUtils.getMethodIfAvailable(System.class, "currentTimeMillis", (Class[]) null); + /** + * Arbitrary {@link Method} reference, indicating no method found in the cache. + */ + private static final Method NO_METHOD_FOUND = ClassUtils.getMethodIfAvailable(System.class, "currentTimeMillis"); + private final Map, Map, Method>> exceptionHandlerCache = new ConcurrentHashMap, Map, Method>>(64); @@ -233,8 +235,8 @@ public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExc } /** - * Uses the {@link DepthComparator} to find the best matching method - * @return the best matching method or {@code null}. + * Uses the {@link ExceptionDepthComparator} to find the best matching method. + * @return the best matching method, or {@code null} if none found */ private Method getBestMatchingMethod( Map, Method> resolverMethods, Exception thrownException) {