From af0bb1920f92ffb5c3e989970703c971ec3129f4 Mon Sep 17 00:00:00 2001 From: Micha Kiener Date: Tue, 9 Mar 2010 08:11:48 +0000 Subject: [PATCH] SPR-6423, generics added to attribute map methods of the conversation object --- .../conversation/manager/ConversationImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/conversation/manager/ConversationImpl.java b/org.springframework.context/src/main/java/org/springframework/conversation/manager/ConversationImpl.java index 97ab5b94ea..df5d2881a6 100644 --- a/org.springframework.context/src/main/java/org/springframework/conversation/manager/ConversationImpl.java +++ b/org.springframework.context/src/main/java/org/springframework/conversation/manager/ConversationImpl.java @@ -101,12 +101,13 @@ public class ConversationImpl extends DestructionAwareAttributeMap implements Mu * * @see org.springframework.conversation.Conversation#getAttribute(java.lang.String) */ + @SuppressWarnings("unchecked") @Override public T getAttribute(String name) { touch(); // first try to get the attribute from this conversation state - T value = super.getAttribute(name); + T value = (T) super.getAttribute(name); if (value != null) { return value; } @@ -114,7 +115,7 @@ public class ConversationImpl extends DestructionAwareAttributeMap implements Mu // the value was not found, try the parent conversation, if any and if // not isolated if (parent != null && !isolated) { - return parent.getAttribute(name); + return (T) parent.getAttribute(name); } // this is the root conversation and the requested bean is not @@ -142,10 +143,11 @@ public class ConversationImpl extends DestructionAwareAttributeMap implements Mu /** * @see org.springframework.conversation.Conversation#removeAttribute(java.lang.String) */ + @SuppressWarnings("unchecked") @Override public T removeAttribute(String name) { touch(); - T value = super.removeAttribute(name); + T value = (T) super.removeAttribute(name); // if the attribute implements the listener interface, remove it from // the registered listeners -- GitLab