Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
3.0
-
None
-
None
-
Unknown
Description
TIssue: @Beanparam annotation class with @queryparam method and method parameters throws array index out of bounds exception
Example - queryxyz(@BeanParam final foo object)
public class Foo{
@QueryParam("q")
public String getQ(){
return "Valid Query";
}
query
Both these line of code seems to be contradictory.
//Method can't be retrieved if there is a parameter
Method getter = bean.getClass().getMethod("get" + propertyName, new Class[]{});
//But, here it expects atleast one parameter that throws the exception. But the exception is swallowed
values.put(annotationValue, new BeanPair(value, m.getParameterAnnotations()[0]));
//No Action here
catch (Throwable t) {
}
private Map<String, BeanPair> getValuesFromBeanParam(Object bean, Class<? extends Annotation> annClass) {
for (Method m : bean.getClass().getMethods()) {
Annotation annotation = m.getAnnotation(annClass);
if (annotation != null) {
try {
Method getter = bean.getClass().getMethod("get" + propertyName, new Class[]{});
values.put(annotationValue, new BeanPair(value, m.getParameterAnnotations()[0]));
} catch (Throwable t) {
}
}
}
return values;
}