Community
Participate
Working Groups
3.1 RC2 Steps to reproduce: - Consider following snippet class Top<E> { void add(E[] e) {} } class Sub extends Top<String> { void add(String... s) {} } - Open AST View and compare the two bindings in the comparison tray -> Method binding in Sub does not override binding in Top
Interestingly, the compiler accepts: class Top<E> { void add(E[] e) {} } class Sub extends Top<String> { @Override void add(String... s) {} } which indicates that the AccOverriding bit got properly set. (if not, it would complain that method doesn't override as expected)
We fisrt check if the declaring classes are compatible (isCompatibleWith(...)) which return false in this case. Should we take the erasures of the declaring classes ?
Actually there is a helper in the compiler for that: findSuperTypeWithSameErasure(...)
+1 for RC3. Reviewed fix with Jerome (need to use supertype with same erasure, and use substituted super method when activating method verifier). Dirk - pls cast your vote.
Adding Dirk to CC to cast a vote
Created attachment 22939 [details] Philippe's patch
Created attachment 22940 [details] Regression test
+1.
Released fix and regression test
Verified using N20050616-0010 + JDT/Core HEAD