Skip to content

Commit 19daba5

Browse files
author
Micha Kiener
committed
SPR-6423, fixing isParent bug in conversation object
1 parent 042dff3 commit 19daba5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,20 @@ public boolean isNested() {
361361
* @see org.springframework.conversation.manager.MutableConversation#isParent()
362362
*/
363363
public boolean isParent() {
364-
return (children != null && children.size() > 0);
365-
}
364+
if (children == null || children.size() == 0) {
365+
return false;
366+
}
367+
368+
// step through the list of children and search for at least one active child conversation in order to
369+
// make this an active parent
370+
for (MutableConversation conversation : children) {
371+
if (!conversation.isEnded()) {
372+
return true;
373+
}
374+
}
375+
376+
return false;
377+
}
366378

367379
/**
368380
* @see org.springframework.conversation.Conversation#isTemporary()

0 commit comments

Comments
 (0)