cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1424525 - in /cxf/trunk: api/src/main/java/org/apache/cxf/interceptor/ rt/core/src/main/java/org/apache/cxf/bus/osgi/ rt/core/src/main/java/org/apache/cxf/interceptor/security/ rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/sa...
Date Thu, 20 Dec 2012 15:23:51 GMT
Author: dkulp
Date: Thu Dec 20 15:23:51 2012
New Revision: 1424525

URL: http://svn.apache.org/viewvc?rev=1424525&view=rev
Log:
Bunch more pre-compiled pattern usage

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/WorkQueueSingleConfig.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
    cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlHeaderInHandler.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
    cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java?rev=1424525&r1=1424524&r2=1424525&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java Thu
Dec 20 15:23:51 2012
@@ -320,10 +320,10 @@ public class URIMappingInterceptor exten
         Map<String, String> queries = new LinkedHashMap<String, String>();
         String query = (String)message.get(Message.QUERY_STRING);
         if (!StringUtils.isEmpty(query)) {            
-            List<String> parts = Arrays.asList(query.split("&"));
+            List<String> parts = Arrays.asList(StringUtils.split(query, "&"));
             for (String part : parts) {
                 if (part.contains("=")) {
-                    String[] keyValue = part.split("=");
+                    String[] keyValue = StringUtils.split(part, "=");
                     if (keyValue.length >= 2) {
                         queries.put(keyValue[0], uriDecode(keyValue[1]));
                     }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/WorkQueueSingleConfig.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/WorkQueueSingleConfig.java?rev=1424525&r1=1424524&r2=1424525&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/WorkQueueSingleConfig.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/WorkQueueSingleConfig.java Thu
Dec 20 15:23:51 2012
@@ -22,6 +22,7 @@ import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.Hashtable;
 
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.workqueue.AutomaticWorkQueueImpl;
 import org.osgi.service.cm.ConfigurationException;
@@ -46,7 +47,7 @@ public class WorkQueueSingleConfig imple
         }
         Dictionary<String, String> p = CastUtils.cast(properties);
         String names = (String)properties.get(PROPERTY_PREFIX + ".names");
-        String[] nameAr = names.split(",");
+        String[] nameAr = StringUtils.split(names, ",");
         for (String name : nameAr) {
             updateQueue(name.trim(), p);
         }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java?rev=1424525&r1=1424524&r2=1424525&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
Thu Dec 20 15:23:51 2012
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.security.SecurityContext;
 
 
@@ -94,7 +95,7 @@ public class SimpleAuthorizingIntercepto
     }
     
     public void setGlobalRoles(String roles) {
-        globalRoles = Arrays.asList(roles.split(" "));
+        globalRoles = Arrays.asList(StringUtils.split(roles, " "));
     }
     
     public void setCheckConfiguredRolesOnly(boolean checkConfiguredRolesOnly) {
@@ -104,7 +105,7 @@ public class SimpleAuthorizingIntercepto
     private static Map<String, List<String>> parseRolesMap(Map<String, String>
rolesMap) {
         Map<String, List<String>> map = new HashMap<String, List<String>>();
         for (Map.Entry<String, String> entry : rolesMap.entrySet()) {
-            map.put(entry.getKey(), Arrays.asList(entry.getValue().split(" ")));
+            map.put(entry.getKey(), Arrays.asList(StringUtils.split(entry.getValue(), " ")));
         }
         return map;
     }

Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlHeaderInHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlHeaderInHandler.java?rev=1424525&r1=1424524&r2=1424525&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlHeaderInHandler.java
(original)
+++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlHeaderInHandler.java
Thu Dec 20 15:23:51 2012
@@ -25,6 +25,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
 
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.message.Message;
 
@@ -42,7 +43,7 @@ public class SamlHeaderInHandler extends
             throwFault("Authorization header must be available and use SAML profile", null);
   
         }
         
-        String[] parts = values.get(0).split(" ");
+        String[] parts = StringUtils.split(values.get(0), " ");
         if (parts.length != 2) {
             throwFault("Authorization header is malformed", null);
         }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java?rev=1424525&r1=1424524&r2=1424525&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/AbstractBindingPolicyValidator.java
Thu Dec 20 15:23:51 2012
@@ -27,6 +27,7 @@ import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.policy.AssertionInfo;
@@ -115,7 +116,7 @@ public abstract class AbstractBindingPol
             for (WSDataRef dataRef : dataRefs) {
                 String xpath = dataRef.getXpath();
                 if (xpath != null) {
-                    String[] nodes = xpath.split("/");
+                    String[] nodes = StringUtils.split(xpath, "/");
                     // envelope/Body || envelope/Header/header || envelope/Header/wsse:Security/header
                     if (nodes.length == 5 && nodes[3].contains("Security")) {
                         continue;

Modified: cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java?rev=1424525&r1=1424524&r2=1424525&view=diff
==============================================================================
--- cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
(original)
+++ cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
Thu Dec 20 15:23:51 2012
@@ -53,6 +53,7 @@ import org.w3c.dom.Document;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.common.jaxb.JAXBContextCache;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.transform.InTransformReader;
@@ -267,8 +268,8 @@ public class WSDiscoveryServiceImpl impl
     private boolean matchURIs(URI probe, URI target) {
         if (compare(target.getScheme(), probe.getScheme()) 
             && compare(target.getAuthority(), probe.getAuthority())) {
-            String[] ppath = probe.getPath().split("/");
-            String[] tpath = target.getPath().split("/");
+            String[] ppath = StringUtils.split(probe.getPath(), "/");
+            String[] tpath = StringUtils.split(target.getPath(), "/");
                     
             if (ppath.length <= tpath.length) {
                 for (int i = 0; i < ppath.length; i++) {



Mime
View raw message