Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5826

Issue on QueryParam with @BeanParam Annotation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 3.0
    • None
    • JAX-RS
    • 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;
      }

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            sath0398 Satheish Kumar Chandraprakasam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: