From 5971f426482ba4241a0a30b141fa6b724457625d Mon Sep 17 00:00:00 2001 From: Ben Hale Date: Tue, 12 Jun 2007 20:50:47 +0000 Subject: [PATCH] I guess it wasn't quite as similar as I thought back in 1.0-maintenance --- .../executor/jsf/FlowSystemCleanupFilter.java | 9 +++------ .../executor/jsf/FlowSystemCleanupFilterTests.java | 12 ------------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilter.java b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilter.java index c1f0b84a..4661df7f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilter.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilter.java @@ -25,7 +25,6 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.web.filter.OncePerRequestFilter; import org.springframework.webflow.context.ExternalContextHolder; -import org.springframework.webflow.execution.FlowExecutionContextHolder; /** * A servlet filter used to guarantee that webflow context information is @@ -48,15 +47,13 @@ public class FlowSystemCleanupFilter extends OncePerRequestFilter { /** * Cleans up the current flow execution in the request context if necessary. - * Specifically, handles unlocking the execution if necessary, setting the - * holder to null, and cleaning up the flow execution context thread local. - * Can be safely called even if no execution is bound or one is bound but - * not locked. + * Specifically, handles unlocking the execution if necessary and setting the + * holder to null. Can be safely called even if no execution is bound or one + * is bound but not locked. * @param request the servlet request */ private void cleanupCurrentFlowExecution(ServletRequest request) { if (isFlowExecutionRestored(request)) { - FlowExecutionContextHolder.setFlowExecutionContext(null); getFlowExecutionHolder(request).unlockFlowExecutionIfNecessary(); request.removeAttribute(getFlowExecutionHolderKey()); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilterTests.java b/spring-webflow/src/test/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilterTests.java index ec3dbf8e..32f0cf6e 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilterTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/executor/jsf/FlowSystemCleanupFilterTests.java @@ -14,7 +14,6 @@ import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.webflow.context.ExternalContextHolder; import org.springframework.webflow.engine.impl.FlowExecutionImpl; -import org.springframework.webflow.execution.FlowExecutionContextHolder; import org.springframework.webflow.test.MockExternalContext; public class FlowSystemCleanupFilterTests extends TestCase { @@ -33,7 +32,6 @@ public class FlowSystemCleanupFilterTests extends TestCase { request.setAttribute(getFlowExecutionHolderKey(), new FlowExecutionHolder(new FlowExecutionImpl())); response = new MockHttpServletResponse(); chain = new MockFilterChain(); - FlowExecutionContextHolder.setFlowExecutionContext(new FlowExecutionImpl()); ExternalContextHolder.setExternalContext(new MockExternalContext()); } @@ -41,11 +39,6 @@ public class FlowSystemCleanupFilterTests extends TestCase { filter.doFilter(request, response, chain); assertNull("Should have cleaned up the flow execution", request.getAttribute(getFlowExecutionHolderKey())); - try { - FlowExecutionContextHolder.getFlowExecutionContext(); - fail("Should have an empty holder"); - } catch (IllegalStateException e) { - } try { ExternalContextHolder.getExternalContext(); fail("Should have an empty holder"); @@ -58,11 +51,6 @@ public class FlowSystemCleanupFilterTests extends TestCase { filter.doFilter(request, response, new ExceptionThrowingMockFilterChain()); } catch (RuntimeException e) { assertNull("Should have cleaned up the flow execution", request.getAttribute(getFlowExecutionHolderKey())); - try { - FlowExecutionContextHolder.getFlowExecutionContext(); - fail("Should have an empty holder"); - } catch (IllegalStateException e1) { - } try { ExternalContextHolder.getExternalContext(); fail("Should have an empty holder");