Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2564

Unwanted auto-boxing while annotation visiting

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.3.8
    • Fix Version/s: 5.4
    • Component/s: tapestry-ioc
    • Labels:
      None

      Description

      class org.apache.tapestry5.ioc.internal.services.AnnotationMemberValueVisitor
      Line #64: final Object result = method.invoke(value);
      If method return boolean, result wil be java.lang.Boolean not boolean.
      In this case in rutime will be Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Enum.

      I fix with:

                      MemberValue memberValue;
                      if (method.getReturnType().isPrimitive()) {
                          memberValue = Annotation.createMemberValue(this.constPool,
                                  this.classPool.get(method.getReturnType().getName()));
                      } else {
                          memberValue = Annotation.createMemberValue(this.constPool,
                                  this.classPool.get(result.getClass().getName()));
                      }
      
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jackvlgv@gmail.com Eugene Vologzhanin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: