Skip to content

Commit af0bb19

Browse files
author
Micha Kiener
committed
SPR-6423, generics added to attribute map methods of the conversation object
1 parent 1ce341b commit af0bb19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

org.springframework.context/src/main/java/org/springframework/conversation/manager/ConversationImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,21 @@ public ConversationImpl() {
101101
*
102102
* @see org.springframework.conversation.Conversation#getAttribute(java.lang.String)
103103
*/
104+
@SuppressWarnings("unchecked")
104105
@Override
105106
public <T> T getAttribute(String name) {
106107
touch();
107108

108109
// first try to get the attribute from this conversation state
109-
T value = super.getAttribute(name);
110+
T value = (T) super.getAttribute(name);
110111
if (value != null) {
111112
return value;
112113
}
113114

114115
// the value was not found, try the parent conversation, if any and if
115116
// not isolated
116117
if (parent != null && !isolated) {
117-
return parent.getAttribute(name);
118+
return (T) parent.getAttribute(name);
118119
}
119120

120121
// this is the root conversation and the requested bean is not
@@ -142,10 +143,11 @@ public <T> T setAttribute(String name, T value) {
142143
/**
143144
* @see org.springframework.conversation.Conversation#removeAttribute(java.lang.String)
144145
*/
146+
@SuppressWarnings("unchecked")
145147
@Override
146148
public <T> T removeAttribute(String name) {
147149
touch();
148-
T value = super.removeAttribute(name);
150+
T value = (T) super.removeAttribute(name);
149151

150152
// if the attribute implements the listener interface, remove it from
151153
// the registered listeners

0 commit comments

Comments
 (0)