Satheish Kumar Chandraprakasam created CXF-5826:
---------------------------------------------------
Summary: Issue on QueryParam with @BeanParam Annotation
Key: CXF-5826
URL: https://issues.apache.org/jira/browse/CXF-5826
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 3.0.0
Reporter: Satheish Kumar Chandraprakasam
Issue: @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;
}
--
This message was sent by Atlassian JIRA
(v6.2#6252)