cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satheish Kumar Chandraprakasam (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-5826) Issue on QueryParam with @BeanParam Annotation
Date Thu, 26 Jun 2014 18:11:24 GMT

     [ https://issues.apache.org/jira/browse/CXF-5826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Satheish Kumar Chandraprakasam updated CXF-5826:
------------------------------------------------

    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;
    }

  was:
Issue:  @Beanparam annotation class with "@queryparam" method annotation "without any method
parameter annotation" throws array index out of bounds exception.  Details listed below.

Example - 
String querySomething(@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;
    }


> 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
>
> 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;
>     }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message