RESOLVED - issue SWF-347: RequestContext.attributes should never be null

http://opensource.atlassian.com/projects/spring/browse/SWF-347
This commit is contained in:
Keith Donald
2007-08-15 15:07:27 +00:00
parent 95c9a9bb61
commit e54cb08fb1
3 changed files with 25 additions and 19 deletions

View File

@@ -1,10 +1,15 @@
SPRING WEB FLOW (SWF) CHANGELOG
===============================
http://www.springframework.org
http://www.springframework.org/webflow
Changes in version 1.0.5 ()
Changes in version 1.0.5 (21.08.2007)
-------------------------------------
Package org.springframework.webflow.engine
* Ensured the RequestContext attribute map can never be null (SWF-347).
Package org.springframework.webflow.execution
* Made the Event class non-final to allow for extension (SWF-330).
Changes in version 1.0.4 (13.06.2007)
-------------------------------------

View File

@@ -55,35 +55,36 @@ class RequestControlContextImpl implements RequestControlContext {
private static final Log logger = LogFactory.getLog(RequestControlContextImpl.class);
/**
* The owning flow execution.
* The owning flow execution carrying out this request.
*/
private FlowExecutionImpl flowExecution;
/**
* The request scope data map.
*/
private LocalAttributeMap requestScope = new LocalAttributeMap();
/**
* A source context for the caller who initiated this request.
*/
private ExternalContext externalContext;
/**
* The last event that occured in this request context.
* The request scope data map. Never null, initially empty.
*/
private LocalAttributeMap requestScope = new LocalAttributeMap();
/**
* Holder for contextual properties describing the currently executing request; never null, initially empty and
* immutable.
*/
private AttributeMap attributes = CollectionUtils.EMPTY_ATTRIBUTE_MAP;
/**
* The last event that occurred in this request context; initially null.
*/
private Event lastEvent;
/**
* The last transition that executed in this request context.
* The last transition that executed in this request context; initially null.
*/
private Transition lastTransition;
/**
* Holder for contextual execution properties.
*/
private AttributeMap attributes;
/**
* Create a new request context.
* @param flowExecution the owning flow execution
@@ -91,8 +92,8 @@ class RequestControlContextImpl implements RequestControlContext {
*/
public RequestControlContextImpl(FlowExecutionImpl flowExecution, ExternalContext externalContext) {
Assert.notNull(flowExecution, "The owning flow execution is required");
this.externalContext = externalContext;
this.flowExecution = flowExecution;
this.externalContext = externalContext;
}
// implementing RequestContext
@@ -224,7 +225,7 @@ class RequestControlContextImpl implements RequestControlContext {
// internal helpers
/**
* Returns the execution listerns for the flow execution of this request context.
* Returns the execution listeners for the flow execution of this request context.
*/
protected FlowExecutionListeners getExecutionListeners() {
return flowExecution.getListeners();

View File

@@ -48,12 +48,12 @@ public class MockRequestContext implements RequestContext {
private MutableAttributeMap requestScope = new LocalAttributeMap();
private MutableAttributeMap attributes = new LocalAttributeMap();
private Event lastEvent;
private Transition lastTransition;
private MutableAttributeMap attributes = new LocalAttributeMap();
/**
* Creates a new mock request context with the following defaults:
* <ul>