cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1447862 - /cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractObservable.java
Date Tue, 19 Feb 2013 18:40:43 GMT
Author: ay
Date: Tue Feb 19 18:40:43 2013
New Revision: 1447862

URL: http://svn.apache.org/r1447862
Log:
[CXF-4838] Server-side EP may throw NPE when a request message arrives while the EP is being
stopped ...

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractObservable.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractObservable.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractObservable.java?rev=1447862&r1=1447861&r2=1447862&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractObservable.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/AbstractObservable.java Tue Feb 19
18:40:43 2013
@@ -40,8 +40,9 @@ public abstract class AbstractObservable
     public synchronized void setMessageObserver(MessageObserver observer) {
         if (observer != incomingObserver) {
             MessageObserver old = incomingObserver;
-            incomingObserver = observer;
+            // the observer switch must take place before activation or after deactivation
             if (observer != null) {
+                incomingObserver = observer;
                 getLogger().fine("registering incoming observer: " + observer);
                 if (old == null) {
                     try {
@@ -56,6 +57,7 @@ public abstract class AbstractObservable
                     getLogger().fine("unregistering incoming observer: " + old);
                     deactivate();
                 }
+                incomingObserver = observer;
             }
         }
     }



Mime
View raw message