diff --git a/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManager.java b/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManager.java index cf006429..d5d73a24 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManager.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManager.java @@ -109,7 +109,8 @@ public class SessionBindingConversationManager implements ConversationManager { // implementing conversation manager public Conversation beginConversation(ConversationParameters conversationParameters) throws ConversationException { - return getConversationContainer().createConversation(conversationParameters, createConversationLock()); + ConversationLock lock = new JdkConcurrentConversationLock(lockTimeoutSeconds); + return getConversationContainer().createConversation(conversationParameters, lock); } public Conversation getConversation(ConversationId id) throws ConversationException { @@ -126,10 +127,6 @@ public class SessionBindingConversationManager implements ConversationManager { // hooks for subclassing - protected ConversationLock createConversationLock() { - return new JdkConcurrentConversationLock(lockTimeoutSeconds); - } - protected ConversationContainer createConversationContainer() { return new ConversationContainer(maxConversations, sessionKey); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java index 1679097d..4ec419eb 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/model/AbstractModel.java @@ -102,30 +102,25 @@ public abstract class AbstractModel implements Model { parent = new LinkedList(parent); Collections.reverse(parent); } - for (T element : parent) { - if (!mergeElement(child, element)) { - addElement(child, element, addAtEnd); - } + for (T parentModel : parent) { + addOrMerge(child, parentModel, addAtEnd); } return child; } - private boolean mergeElement(LinkedList child, T element) { - for (T childElement : child) { - if (childElement.isMergeableWith(element)) { - childElement.merge(element); - return true; + private void addOrMerge(LinkedList list, T modelToMerge, boolean addAtEnd) { + for (T model : list) { + if (model.isMergeableWith(modelToMerge)) { + model.merge(modelToMerge); + return; } } - return false; - } - - @SuppressWarnings("unchecked") - private void addElement(LinkedList child, T element, boolean addAtEnd) { + @SuppressWarnings("unchecked") + T copy = (T) modelToMerge.createCopy(); if (addAtEnd) { - child.addLast((T) element.createCopy()); + list.addLast(copy); } else { - child.addFirst((T) element.createCopy()); + list.addFirst(copy); } }