Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

LPS-27436 #219

Closed
wants to merge 4 commits into from

3 participants

@ghost

No description provided.

@juanferrub
Owner
@ghost ghost closed this
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 5 deletions.
  1. +22 −5 portal-impl/src/com/liferay/portal/action/JSONServiceAction.java
View
27 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,11 +421,23 @@ else if (typeNameOrClassDescriptor.startsWith("java.util.Map")) {
String[] parameterTypes)
throws Exception {
+ StringBundler keyStringBundler = new StringBundler(5);
+
+ keyStringBundler.append(clazz.getName());
+ keyStringBundler.append("_METHOD_NAME_");
+ keyStringBundler.append(methodName);
+ keyStringBundler.append("_PARAMETERS_");
+
String parameterTypesNames = StringUtil.merge(parameterTypes);
- String key =
- clazz.getName() + "_METHOD_NAME_" + methodName + "_PARAMETERS_" +
- parameterTypesNames;
+ if (Validator.isNull(parameterTypesNames)) {
+ keyStringBundler.append(parameters.length);
+ }
+ else {
+ keyStringBundler.append(parameterTypesNames);
+ }
+
+ String key = keyStringBundler.toString();
Object[] methodAndParameterTypes = _methodCache.get(key);
@@ -465,10 +478,12 @@ else if (typeNameOrClassDescriptor.startsWith("java.util.Map")) {
}
}
else if (method != null) {
+ String parameterNames = StringUtil.merge(parameters);
+
_log.error(
"Obscure method name for class " + clazz +
", method " + methodName + ", and parameters " +
- parameterTypesNames);
+ parameterNames);
return null;
}
@@ -490,9 +505,11 @@ else if (method != null) {
return methodAndParameterTypes;
}
else {
+ String parameterNames = StringUtil.merge(parameters);
+
_log.error(
"No method found for class " + clazz + ", method " +
- methodName + ", and parameters " + parameterTypesNames);
+ methodName + ", and parameters " + parameterNames);
return null;
}
Something went wrong with that request. Please try again.