Community
Participate
Working Groups
HEAD - Redundant superinterface not flagged inside same declaration import java.util.ArrayList; import java.util.Collection; import java.util.List; public interface Mix<E> extends List<E>, Collection<E> { } abstract class AbstractMix implements List<Object>, Collection<Object> { } class MixList<E> extends ArrayList<E> implements List<E> { } abstract class A implements Runnable {} abstract class B extends A implements Runnable {} interface I {} class X implements I {} class Y extends X implements I {} => In the first 2 types, Collection<E> is not flagged as redundant, although it is. Rest is OK.
We only detect redundant super interfaces when they come from the superclass.
Created attachment 146887 [details] Proposed fix
Kent, please review. We might have a better place to make the detection. If ok, I'll add some regression tests.
Created attachment 146888 [details] Proposed fix Same patch without two unused imports.
Created attachment 146899 [details] Regression test
Created attachment 146974 [details] Proposed patch and testcase
Released in HEAD for 3.6M2
Verified for 3.6M2 using I20090914-1800
Reopening, the fix is not good. In I20090929-0800, I get problems on List, but it's not List that is redundant, it's Collection. In real life, I got compile errors after applying the quick fix for this problem in org.eclipse.jdt.internal.corext.fix.StringFix 1.18.
Created attachment 148645 [details] Proposed fix + regression test Kent, please review. I think the mistake only comes from the order of the parameters for the problem reporter method.
Looks good - I screwed up & got the interfaces backwards in the call to the problem reporter. Released to HEAD for 3.6M3
Screwed up with the verification for M1. Verified for 3.6M3 using build I20091025-2000
*** Bug 294389 has been marked as a duplicate of this bug. ***