fixed 1.5 bug
This commit is contained in:
@@ -20,6 +20,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.core.JdkVersion;
|
||||
import org.springframework.webflow.conversation.Conversation;
|
||||
import org.springframework.webflow.conversation.ConversationId;
|
||||
import org.springframework.webflow.conversation.ConversationParameters;
|
||||
@@ -98,7 +99,11 @@ class ConversationContainer implements Serializable {
|
||||
}
|
||||
|
||||
private ConversationId nextId() {
|
||||
return new SimpleConversationId(Integer.valueOf(++conversationIdSequence));
|
||||
if (JdkVersion.isAtLeastJava15()) {
|
||||
return new SimpleConversationId(Integer.valueOf(++conversationIdSequence));
|
||||
} else {
|
||||
return new SimpleConversationId(new Integer(++conversationIdSequence));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -226,7 +226,6 @@ public class ViewState extends TransitionableState {
|
||||
|
||||
public void exit(RequestControlContext context) {
|
||||
super.exit(context);
|
||||
destroyVariables(context);
|
||||
if (history == History.PRESERVE) {
|
||||
context.updateCurrentFlowExecutionSnapshot();
|
||||
} else if (history == History.DISCARD) {
|
||||
@@ -234,6 +233,7 @@ public class ViewState extends TransitionableState {
|
||||
} else if (history == History.INVALIDATE) {
|
||||
context.removeAllFlowExecutionSnapshots();
|
||||
}
|
||||
destroyVariables(context);
|
||||
}
|
||||
|
||||
// internal helpers
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.core.JdkVersion;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.webflow.conversation.Conversation;
|
||||
@@ -157,7 +158,7 @@ public abstract class AbstractFlowExecutionRepository implements FlowExecutionRe
|
||||
if (alwaysGenerateNewNextKey) {
|
||||
CompositeFlowExecutionKey key = (CompositeFlowExecutionKey) execution.getKey();
|
||||
Integer continuationId = (Integer) key.getContinuationId();
|
||||
Integer nextId = Integer.valueOf(continuationId.intValue() + 1);
|
||||
Integer nextId = nextContinuationId(continuationId);
|
||||
return new CompositeFlowExecutionKey(key.getConversationId(), nextId);
|
||||
} else {
|
||||
return execution.getKey();
|
||||
@@ -232,6 +233,14 @@ public abstract class AbstractFlowExecutionRepository implements FlowExecutionRe
|
||||
return conversation;
|
||||
}
|
||||
|
||||
private Integer nextContinuationId(Integer continuationId) {
|
||||
if (JdkVersion.isAtLeastJava15()) {
|
||||
return Integer.valueOf(continuationId.intValue() + 1);
|
||||
} else {
|
||||
return new Integer(continuationId.intValue() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private Serializable parseContinuationId(String encodedId, String encodedKey) {
|
||||
try {
|
||||
return Integer.valueOf(encodedId);
|
||||
|
||||
Reference in New Issue
Block a user