SWF-1459 Ensure new FlowExecution instances are created with own copy of execution attributes map.

This commit is contained in:
Rossen Stoyanchev
2011-06-30 10:04:09 +00:00
parent 5b0cf929da
commit b3b466a088
2 changed files with 2 additions and 1 deletions

View File

@@ -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;

View File

@@ -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() {