cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject cxf git commit: Few minor improvements
Date Wed, 11 Feb 2015 13:29:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 46f271b69 -> 71a1d1425


Few minor improvements


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

Branch: refs/heads/master
Commit: 71a1d1425c7cbfb6d410e6655f3579131d1fab3e
Parents: 46f271b
Author: Alessio Soldano <asoldano@redhat.com>
Authored: Wed Feb 11 14:27:14 2015 +0100
Committer: Alessio Soldano <asoldano@redhat.com>
Committed: Wed Feb 11 14:28:37 2015 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/transport/AbstractObservable.java     | 11 +++++++++--
 .../cxf/jaxws/handler/AnnotationHandlerChainBuilder.java |  8 +++++---
 .../main/java/org/apache/cxf/frontend/WSDLGetUtils.java  |  5 +++--
 3 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/71a1d142/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java b/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
index fdda914..35a2f16 100644
--- a/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
+++ b/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.transport;
 
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
@@ -43,7 +44,10 @@ public abstract class AbstractObservable implements Observable {
             // the observer switch must take place before activation or after deactivation
             if (observer != null) {
                 incomingObserver = observer;
-                getLogger().fine("registering incoming observer: " + observer);
+                final Logger logger = getLogger();
+                if (logger.isLoggable(Level.FINE)) {
+                    logger.fine("registering incoming observer: " + observer);
+                }
                 if (old == null) {
                     try {
                         activate();
@@ -54,7 +58,10 @@ public abstract class AbstractObservable implements Observable {
                 }
             } else {
                 if (old != null) {
-                    getLogger().fine("unregistering incoming observer: " + old);
+                    final Logger logger = getLogger();
+                    if (logger.isLoggable(Level.FINE)) {
+                        logger.fine("unregistering incoming observer: " + old);
+                    }
                     deactivate();
                 }
                 incomingObserver = observer;

http://git-wip-us.apache.org/repos/asf/cxf/blob/71a1d142/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
index 4319373..914db9e 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
@@ -77,7 +77,9 @@ public class AnnotationHandlerChainBuilder extends HandlerChainBuilder {
         HandlerChainAnnotation hcAnn = findHandlerChainAnnotation(clz, true);
         List<Handler> chain = null;
         if (hcAnn == null) {
-            LOG.fine("no HandlerChain annotation on " + clz);
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("no HandlerChain annotation on " + clz);
+            }
             chain = new ArrayList<Handler>();
         } else {
             hcAnn.validate();
@@ -215,8 +217,6 @@ public class AnnotationHandlerChainBuilder extends HandlerChainBuilder
{
                                                "NOT_A_QNAME_PATTER",
                                                namePattern, xml));                    
         }
-        String localPart = namePattern.substring(namePattern.indexOf(':') + 1,
-                                                 namePattern.length());
         String pfx = namePattern.substring(0, namePattern.indexOf(':'));
         String ns = el.lookupNamespaceURI(pfx);
         if (ns == null) {
@@ -225,6 +225,8 @@ public class AnnotationHandlerChainBuilder extends HandlerChainBuilder
{
         if (!ns.equals(comp.getNamespaceURI())) {
             return false;
         }
+        String localPart = namePattern.substring(namePattern.indexOf(':') + 1,
+                                                 namePattern.length());
         if (localPart.contains("*")) {
             //wildcard pattern matching
             return Pattern.matches(mapPattern(localPart), comp.getLocalPart());

http://git-wip-us.apache.org/repos/asf/cxf/blob/71a1d142/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
index c0b545f..8ab1437 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
@@ -166,10 +166,11 @@ public class WSDLGetUtils {
         throws UnsupportedEncodingException {
         String key = loc;
         try {
-            if (!(new URI(loc).isAbsolute()) && xsd != null) {
+            boolean absoluteLocUri = new URI(loc).isAbsolute();
+            if (!absoluteLocUri && xsd != null) {
                 key = new URI(xsd).resolve(loc).toString();
             }
-            if (!(new URI(loc).isAbsolute()) && xsd == null) {
+            if (!absoluteLocUri && xsd == null) {
                 key = new URI(".").resolve(loc).toString();
             }
         } catch (URISyntaxException e) {


Mime
View raw message