From 9884d075b0d2e2f61457c7e86290ae50215b3306 Mon Sep 17 00:00:00 2001 From: Erwin Vervaet Date: Sun, 1 Apr 2007 18:28:15 +0000 Subject: [PATCH] AbstractConversationFlowExecutionRepository.parseFlowExecutionKey() now throws an BadlyFormattedFlowExecutionKeyException when asked to parse an empty flow execution key (SWF-277). --- spring-webflow/changelog.txt | 2 ++ .../AbstractConversationFlowExecutionRepository.java | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-webflow/changelog.txt b/spring-webflow/changelog.txt index d542b05f..3678d23c 100644 --- a/spring-webflow/changelog.txt +++ b/spring-webflow/changelog.txt @@ -50,6 +50,8 @@ Package org.springframework.webflow.execution * Added FlowExecutionListener.sessionCreated(RequestContext, FlowSession) callback, useful for setting flow attributes before the flow starts (SWF-223). * ClientContinuationFlowExecutionRepository now uses 'URL-safe Base64 encoding' (SWF-270). +* AbstractConversationFlowExecutionRepository.parseFlowExecutionKey() now throws an + BadlyFormattedFlowExecutionKeyException when asked to parse an empty flow execution key (SWF-277). Package org.springframework.webflow.executor * Added resource URL encoding to redirects in a JSF environment (SWF-256). diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/support/AbstractConversationFlowExecutionRepository.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/support/AbstractConversationFlowExecutionRepository.java index 83826d43..c456be19 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/support/AbstractConversationFlowExecutionRepository.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/repository/support/AbstractConversationFlowExecutionRepository.java @@ -20,6 +20,7 @@ import java.io.Serializable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.util.Assert; +import org.springframework.util.StringUtils; import org.springframework.webflow.conversation.Conversation; import org.springframework.webflow.conversation.ConversationException; import org.springframework.webflow.conversation.ConversationId; @@ -141,7 +142,10 @@ public abstract class AbstractConversationFlowExecutionRepository extends Abstra } public FlowExecutionKey parseFlowExecutionKey(String encodedKey) throws FlowExecutionRepositoryException { - Assert.hasText(encodedKey, "The string encoded flow execution key is required"); + if (!StringUtils.hasText(encodedKey)) { + throw new BadlyFormattedFlowExecutionKeyException(encodedKey, + "The string encoded flow execution key is required"); + } String[] keyParts = CompositeFlowExecutionKey.keyParts(encodedKey);