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

javac, bridge methods are not getting the flags from the original method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b17
    • Verification:
      Not verified

      Backports

        Description

        While exploring adding covariant overrides for Buffer classes, it was discovered that javac is not making synthetic methods for covariant overrides match the finality of the covariant method.

        Simple illustration:

          public class Test {
              public Object foo() { return null; }
          }
          public class TestSub extends Test {
              public final String foo() { return null; }
          }

        Yields (javap output):

          public class Test {
            public Test();
            public java.lang.Object foo();
          }
          public class TestSub extends Test {
            public TestSub();
            public final java.lang.String foo();
            public java.lang.Object foo(); // <- not final?!
          }

        reported in compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-April/008732.html

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  vromero Vicente Arturo Romero Zaldivar
                  Reporter:
                  vromero Vicente Arturo Romero Zaldivar
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: