Summary: | [compiler] Should be more resilient with duplicate fields/methods | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> | ||||||||
Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | enhancement | ||||||||||
Priority: | P3 | CC: | david_audel, markus.kell.r | ||||||||
Version: | 3.2 | ||||||||||
Target Milestone: | 3.5 M3 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 156731 | ||||||||||
Attachments: |
|
Description
Philipe Mulet
2006-06-13 03:27:44 EDT
To be investigated during M7 Nice to have. I wouldn't change this at this point in the release cycle. Removing 3.3M7 target From this testcase, we delete both duplicate fields & methods (but we keep the first duplicate superinterface, member type & thrown exception) : class X<T> implements I, I { int i; boolean i; void bar() { M m = new M(); m.foo(); if (i) { try { test(); } catch ( Ex e ) {} } } public void test() throws Ex, Ex {} // do not complain about extra Ex class M { void foo() {} void foo() {} } class M {} } interface I { void test() throws Ex, Ex; // do not complain about extra Ex } @SuppressWarnings("serial") class Ex extends Exception {} Created attachment 115077 [details]
Proposed patch with testcase for duplicate fields
This patch keeps the first duplicate field & removes the rest
Created attachment 115301 [details]
Proposed patch with testcases
Fix released for 3.5M3 Updated tests in 8 different test classes including NegativeTest and MethodVerifyTest Created attachment 115727 [details]
Proposed patch with testcases
Releasing this patch instead.
Both duplicate fields and methods will receive errors but the binding for the first field/method will still exist to reduce secondary errors.
Verified for 3.5M3 using I20081026-2000 build. See bug 255035 for additional change when a duplicate method did not have a return type |