JDK-8035259 : javac, incorrect shadowing of classes vs type parameters
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-02-18
  • Updated: 2017-07-12
  • Resolved: 2014-11-05
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 9
9 b39Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
The following snippet compiles with javac7, but not javac8-b128.

===
class Test {
  class T<E> {}
  abstract class One<E> {
    abstract E foo();
  }
  abstract class Two<T> extends One<T> {
    abstract T foo();
  }
}
===

error: foo() in Test.Two cannot override foo() in Test.One
    abstract T foo();
               ^
  return type T is not compatible with Test.T
  where T,E are type-variables:
    T extends Object declared in class Test.Two
    E extends Object declared in class Test.One


Type parameter T should be shadowing the inner class Test.T

reported in compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-February/008515.html
Comments
This is causing some regressions.
02-09-2014

ILW=HLL -> P3
10-03-2014

Release team: Approved for deferral.
25-02-2014