Visibility bridge methods cannot be added for final methods

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P3
    • tbd
    • Affects Version/s: 8u51, 9, 25
    • Component/s: core-libs

      FULL PRODUCT VERSION :
      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]

      A DESCRIPTION OF THE PROBLEM :
      javac adds visibility bridges to work around limitations of the reflection system when inheriting public methods of non-public types.

      This does not work for final methods: https://gist.github.com/raphw/7d10ae082ace5886d601

      REGRESSION. Last worked in version 8u51

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      https://gist.github.com/raphw/7d10ae082ace5886d601

      Compile and run to reproduce error.

      EXPECTED VERSUS ACTUAL BEHAVIOUR :
      EXPECTED -
      Should not throw an exception for final methods.
      ACTUAL -
      Throws an exception

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      IllegalAccessException

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      https://gist.github.com/raphw/7d10ae082ace5886d601
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No work around possible due to final method.

        1. Foo.java
          0.1 kB
        2. VisibilityBridgeTest.java
          0.3 kB
        3. VisibilityBridgeTest.java
          0.6 kB
        4. Foo.java
          0.2 kB

            Assignee:
            Chen Liang
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: