| Summary: | [1.5][compiler] Wrong compiler error when using static method with same signature as non static one but with variable arguments | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Miquel Herrera <miquel> | ||||
| Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eric_jodet, Olivier_Thomann | ||||
| Version: | 3.3.1 | ||||||
| Target Milestone: | 3.4 M6 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 92491 [details]
Proposed patch with testcase
Released into HEAD for 3.4M6 Verified for 3.4M6 using build I20080324-1300 |
Build ID: M20071023-1652 Steps To Reproduce: Create a final class with two methods such as: public final class AndExpression { public static AndExpression and(WhereExpression... expression) { return new AndExpression(expression); } public AndExpression and(WhereExpression expression) { this.group.add(expression); return this; } } Then import statically in another place like: import static uk.nominet.core.search.builder.expression.AndExpression.and; and use it as: query.setWhereCondition( and(query.getWhereCondition()) .and(query.getOtherWhereCondition())); More information: class AndExpression in the example, compiles well into eclipse but you get an error of the type The method and(WhereExpression) is undefined for the type THE_TYPE_WHERE_YOU_USE_AND_METHOD However that construction is perfectly valid and java compiler does not complain at all.