Bug 216930 - [1.5][compiler] Wrong compiler error when using static method with same signature as non static one but with variable arguments
Summary: [1.5][compiler] Wrong compiler error when using static method with same signa...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-29 11:31 EST by Miquel Herrera CLA
Modified: 2008-03-26 03:16 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch with testcase (4.92 KB, patch)
2008-03-13 14:58 EDT, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miquel Herrera CLA 2008-01-29 11:31:49 EST
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.
Comment 1 Kent Johnson CLA 2008-03-13 14:58:47 EDT
Created attachment 92491 [details]
Proposed patch with testcase
Comment 2 Kent Johnson CLA 2008-03-13 14:59:38 EDT
Released into HEAD for 3.4M6
Comment 3 Eric Jodet CLA 2008-03-26 03:16:33 EDT
Verified for 3.4M6 using build I20080324-1300