JDK-8042785 : javac, bridge methods are not getting the flags from the original method
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-05-08
  • Updated: 2014-07-29
  • Resolved: 2014-05-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u20Fixed 9 b17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
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
Comments
ManualVerify: The changset was reverted, so closing the bug as unverified. See related bug, https://bugs.openjdk.java.net/browse/JDK-8044487
25-06-2014