From b3b466a088babac650894b2ca54378cc6108a69e Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Thu, 30 Jun 2011 10:04:09 +0000 Subject: [PATCH] SWF-1459 Ensure new FlowExecution instances are created with own copy of execution attributes map. --- .../webflow/engine/impl/FlowExecutionImplFactory.java | 2 +- .../webflow/engine/impl/FlowExecutionImplFactoryTests.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java index 478388d7..acc704c6 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java @@ -78,7 +78,7 @@ public class FlowExecutionImplFactory implements FlowExecutionFactory { logger.debug("Creating new execution of '" + flowDefinition.getId() + "'"); } FlowExecutionImpl execution = new FlowExecutionImpl((Flow) flowDefinition); - execution.setAttributes(executionAttributes); + execution.setAttributes(new LocalAttributeMap(executionAttributes.asMap())); execution.setListeners(executionListenerLoader.getListeners(execution.getDefinition())); execution.setKeyFactory(executionKeyFactory); return execution; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java index c0813beb..88a4d711 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java @@ -85,6 +85,7 @@ public class FlowExecutionImplFactoryTests extends TestCase { factory.setExecutionAttributes(attributes); FlowExecution execution = factory.createFlowExecution(flowDefinition); assertEquals(attributes, execution.getAttributes()); + assertNotSame(attributes, execution.getAttributes()); } public void testCreateWithExecutionListener() {