cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [1/2] cxf git commit: [CXF-6232] avoid setting the property at the wrong place
Date Wed, 25 Mar 2015 17:18:44 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes e3580d7a6 -> fa3a3cba6


[CXF-6232] avoid setting the property at the wrong place


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c0ebc255
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c0ebc255
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c0ebc255

Branch: refs/heads/3.0.x-fixes
Commit: c0ebc2556820c57b9f1255e9b046a0560e54e68a
Parents: e3580d7
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Wed Mar 25 15:24:46 2015 +0100
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Wed Mar 25 17:30:27 2015 +0100

----------------------------------------------------------------------
 .../websocket/atmosphere/DefaultProtocolInterceptor.java  | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c0ebc255/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
index 2bc83b6..710a90c 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
@@ -120,10 +120,10 @@ public class DefaultProtocolInterceptor extends AtmosphereInterceptorAdapter
{
                 }
                 try {
                     AtmosphereRequest ar = createAtmosphereRequest(request, data);
-                    ar.setAttribute(REQUEST_DISPATCHED, "true");
+                    ar.attributes().put(REQUEST_DISPATCHED, "true");
                     String refid = ar.getHeader(WebSocketConstants.DEFAULT_REQUEST_ID_KEY);
                     if (refid != null) {
-                        ar.setAttribute(WebSocketConstants.DEFAULT_REQUEST_ID_KEY, refid);
+                        ar.attributes().put(WebSocketConstants.DEFAULT_REQUEST_ID_KEY, refid);
                     }
                     // This is a new request, we must clean the Websocket AtmosphereResource.
                     request.removeAttribute(FrameworkConfig.INJECTED_ATMOSPHERE_RESOURCE);
@@ -150,8 +150,6 @@ public class DefaultProtocolInterceptor extends AtmosphereInterceptorAdapter
{
                 return Action.CONTINUE;
             }           
         } else {
-            request.setAttribute(REQUEST_DISPATCHED, null);
-            request.setAttribute(RESPONSE_PARENT, null);
             request.destroyable(false);
         }
         return Action.CONTINUE;
@@ -253,8 +251,8 @@ public class DefaultProtocolInterceptor extends AtmosphereInterceptorAdapter
{
                 LOG.log(Level.INFO, "transformPayload with draft={0}", new String(responseDraft));
             }
             AtmosphereRequest request = response.request();
-            if (request.getAttribute(RESPONSE_PARENT) == null) {
-                request.setAttribute(RESPONSE_PARENT, "true");
+            if (request.attributes().get(RESPONSE_PARENT) == null) {
+                request.attributes().put(RESPONSE_PARENT, "true");
                 return createResponse(response, responseDraft, true);
             } else {
                 return createResponse(response, responseDraft, false);


Mime
View raw message