Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8064298

PropertyDescriptor can't see annotation on overridden method of inner-subclass

XMLWordPrintable

    • b87
    • 8
    • x86_64
    • linux

      FULL PRODUCT VERSION :
      java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux quine 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      propertyDescriptor.getReadMethod().getAnnotation() does not return Annotations declared on overridden methods of inner classes.

      See the example at https://gist.github.com/gdubya/4d99fef5bf874046f930

      Note: If I move the inner class to a top-level class then the test passes!

      REGRESSION. Last worked in version 7u71

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.7.0_71"
      Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Clone / download the code at https://gist.github.com/gdubya/4d99fef5bf874046f930

      Run EntityTest to reproduce the problem.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The PropertyDescriptor should find the annotation.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      See https://gist.github.com/gdubya/4d99fef5bf874046f930
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      class.getMethod("getName").getAnnotation(MySubAnnotation.class) works, however I would prefer to use a PropertyDescriptor over a Method.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: