Skip to content

Commit

Permalink
LPS-27436 replace string+ with StringBundler for key
Browse files Browse the repository at this point in the history
  • Loading branch information
igr authored and brianchandotcom committed May 22, 2012
1 parent 231457e commit 31b24aa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions portal-impl/src/com/liferay/portal/action/JSONServiceAction.java
Expand Up @@ -27,6 +27,7 @@
import com.liferay.portal.kernel.util.LocalizationUtil; import com.liferay.portal.kernel.util.LocalizationUtil;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.SetUtil; 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.StringPool;
import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
Expand Down Expand Up @@ -420,18 +421,24 @@ protected Object[] getMethodAndParameterTypes(
String[] parameterTypes) String[] parameterTypes)
throws Exception { throws Exception {


String key = StringBundler keyStringBundler = new StringBundler(5);
clazz.getName() + "_METHOD_NAME_" + methodName + "_PARAMETERS_";
keyStringBundler.append(clazz.getName());
keyStringBundler.append("_METHOD_NAME_");
keyStringBundler.append(methodName);
keyStringBundler.append("_PARAMETERS_");


String parameterTypesNames = StringUtil.merge(parameterTypes); String parameterTypesNames = StringUtil.merge(parameterTypes);


if (Validator.isNull(parameterTypesNames)) { if (Validator.isNull(parameterTypesNames)) {
key += parameters.length; keyStringBundler.append(parameters.length);
} }
else { else {
key += parameterTypesNames; keyStringBundler.append(parameterTypesNames);
} }


String key = keyStringBundler.toString();

Object[] methodAndParameterTypes = _methodCache.get(key); Object[] methodAndParameterTypes = _methodCache.get(key);


if (methodAndParameterTypes != null) { if (methodAndParameterTypes != null) {
Expand Down

0 comments on commit 31b24aa

Please sign in to comment.