SWF-1459 Ensure new FlowExecution instances are created with own copy of execution attributes map.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user