cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/2] cxf git commit: Fix unit test
Date Thu, 09 Feb 2017 20:25:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 702389744 -> c903d27ec


Fix unit test


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

Branch: refs/heads/master
Commit: 71f35e5c3f8b6a2df43b4f15844f7b1f972e4340
Parents: 7023897
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Feb 9 14:08:06 2017 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Feb 9 15:24:21 2017 -0500

----------------------------------------------------------------------
 .../logging/event/DefaultLogEventMapper.java    | 30 +++-----------------
 1 file changed, 4 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/71f35e5c/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
index 8324dae..abf3a06 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
@@ -29,7 +29,6 @@ import java.util.Set;
 import java.util.UUID;
 
 import javax.security.auth.Subject;
-import javax.xml.stream.XMLStreamReader;
 
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
@@ -42,7 +41,6 @@ import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.service.model.ServiceModelUtil;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.ContextUtils;
 
@@ -156,7 +154,7 @@ public class DefaultLogEventMapper implements LogEventMapper {
                     }
                     uri = address + uri;
                 }
-            } else {
+            } else if (address != null) {
                 uri = address;
             }
         }
@@ -207,19 +205,6 @@ public class DefaultLogEventMapper implements LogEventMapper {
         BindingOperationInfo boi = null;
 
         boi = message.getExchange().getBindingOperationInfo();
-        if (null == boi) {
-            boi = getOperationFromContent(message);
-        }
-
-        if (null == boi) {
-            Message inMsg = message.getExchange().getInMessage();
-            if (null != inMsg) {
-                Message reqMsg = inMsg.getExchange().getInMessage();
-                if (null != reqMsg) {
-                    boi = getOperationFromContent(reqMsg);
-                }
-            }
-        }
 
         if (null != boi) {
             operationName = boi.getName().toString();
@@ -228,15 +213,6 @@ public class DefaultLogEventMapper implements LogEventMapper {
         return operationName;
     }
 
-    private BindingOperationInfo getOperationFromContent(Message message) {
-        XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class);
-        if (xmlReader != null) {
-            return ServiceModelUtil.getOperation(message.getExchange(), xmlReader.getName());
-        } else {
-            return null;
-        }
-    }
-
     private Message getEffectiveMessage(Message message) {
         boolean isRequestor = MessageUtils.isRequestor(message);
         boolean isOutbound = MessageUtils.isOutbound(message);
@@ -258,7 +234,9 @@ public class DefaultLogEventMapper implements LogEventMapper {
         String requestUri = safeGet(message, Message.REQUEST_URI);
         if (requestUri != null) {
             String basePath = safeGet(message, Message.BASE_PATH);
-            if (basePath != null && requestUri.startsWith(basePath)) {
+            if (basePath == null) {
+                path = requestUri;
+            } else if (requestUri.startsWith(basePath)) {
                 path = requestUri.substring(basePath.length());
             }
             if (path.isEmpty()) {


Mime
View raw message