Skip to content
Browse files

LPS-27436 replace string+ with StringBundler for key

  • Loading branch information...
1 parent 231457e commit 31b24aa377d392f85b462e97ca4226fc71b12f21 @igorspasic igorspasic committed with brianchandotcom
Showing with 11 additions and 4 deletions.
  1. +11 −4 portal-impl/src/com/liferay/portal/action/JSONServiceAction.java
View
15 portal-impl/src/com/liferay/portal/action/JSONServiceAction.java
@@ -27,6 +27,7 @@
import com.liferay.portal.kernel.util.LocalizationUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.SetUtil;
+import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
@@ -420,18 +421,24 @@ else if (typeNameOrClassDescriptor.startsWith("java.util.Map")) {
String[] parameterTypes)
throws Exception {
- String key =
- clazz.getName() + "_METHOD_NAME_" + methodName + "_PARAMETERS_";
+ StringBundler keyStringBundler = new StringBundler(5);
+
+ keyStringBundler.append(clazz.getName());
+ keyStringBundler.append("_METHOD_NAME_");
+ keyStringBundler.append(methodName);
+ keyStringBundler.append("_PARAMETERS_");
String parameterTypesNames = StringUtil.merge(parameterTypes);
if (Validator.isNull(parameterTypesNames)) {
- key += parameters.length;
+ keyStringBundler.append(parameters.length);
}
else {
- key += parameterTypesNames;
+ keyStringBundler.append(parameterTypesNames);
}
+ String key = keyStringBundler.toString();
+
Object[] methodAndParameterTypes = _methodCache.get(key);
if (methodAndParameterTypes != null) {

0 comments on commit 31b24aa

Please sign in to comment.
Something went wrong with that request. Please try again.