Author: veithen
Date: Thu Dec 20 12:56:47 2012
New Revision: 1424445
URL: http://svn.apache.org/viewvc?rev=1424445&view=rev
Log:
String#split is bad for performance.
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java?rev=1424445&r1=1424444&r2=1424445&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java
Thu Dec 20 12:56:47 2012
@@ -293,15 +293,15 @@ public class Utils {
if (path == null || serviceName == null) {
return null;
}
- String[] temp = path.split(serviceName + "/");
+ int idx = path.lastIndexOf(serviceName + "/");
String operationName = null;
- if (temp.length > 1) {
- operationName = temp[temp.length - 1];
+ if (idx != -1) {
+ operationName = path.substring(idx + serviceName.length() + 1);
} else {
//this scenario occurs if the endpoint name is there in the URL
after service name
- temp = path.split(serviceName + ".");
- if (temp.length > 1) {
- operationName = temp[temp.length - 1];
+ idx = path.lastIndexOf(serviceName + ".");
+ if (idx != -1) {
+ operationName = path.substring(idx + serviceName.length() + 1);
operationName =
operationName.substring(operationName.indexOf('/') + 1);
}
}