From 87af61b8774cc9fef528378aa97584af191efc0d Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 27 Jul 2011 22:38:59 +0000 Subject: [PATCH] polishing git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4808 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../annotation/AnnotationMethodHandlerAdapter.java | 2 -- .../annotation/AnnotationMethodHandlerAdapter.java | 11 +++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java index 9c25d1d254e..c9953871efe 100644 --- a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java +++ b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java @@ -59,7 +59,6 @@ import org.springframework.beans.factory.config.BeanExpressionContext; import org.springframework.beans.factory.config.BeanExpressionResolver; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.core.LocalVariableTableParameterNameDiscoverer; -import org.springframework.core.MethodParameter; import org.springframework.core.Ordered; import org.springframework.core.ParameterNameDiscoverer; import org.springframework.core.annotation.AnnotationUtils; @@ -418,7 +417,6 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator * @return the PortletRequestDataBinder instance to use * @throws Exception in case of invalid state or arguments * @see PortletRequestDataBinder#bind(javax.portlet.PortletRequest) - * @see PortletRequestDataBinder#convertIfNecessary(Object, Class, MethodParameter) */ protected PortletRequestDataBinder createBinder(PortletRequest request, Object target, String objectName) throws Exception { return new PortletRequestDataBinder(target, objectName); diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java index c6b97a56a65..d82683047fc 100644 --- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java +++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java @@ -394,14 +394,13 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator throws Exception { Class clazz = ClassUtils.getUserClass(handler); - Boolean annotated = this.sessionAnnotatedClassesCache.get(clazz); - - if (annotated == null) { - annotated = (AnnotationUtils.findAnnotation(handler.getClass(), SessionAttributes.class) != null); - this.sessionAnnotatedClassesCache.put(clazz, annotated); + Boolean annotatedWithSessionAttributes = this.sessionAnnotatedClassesCache.get(clazz); + if (annotatedWithSessionAttributes == null) { + annotatedWithSessionAttributes = (AnnotationUtils.findAnnotation(clazz, SessionAttributes.class) != null); + this.sessionAnnotatedClassesCache.put(clazz, annotatedWithSessionAttributes); } - if (annotated) { + if (annotatedWithSessionAttributes) { // Always prevent caching in case of session attribute management. checkAndPrepare(request, response, this.cacheSecondsForSessionAttributeHandlers, true); // Prepare cached set of session attributes names.