| Summary: | Compiler erroneously reports "Method is ambigious for type" | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Christopher Schultz <chris> | ||||
| Component: | Core | Assignee: | Sasikanth Bharadwaj <sasikanth.bharadwaj> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | mlgiroux, sairam71, srikanth_sankaran | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
Created attachment 210007 [details]
Source file which demonstrates this problem.
Shorter test case:
//------------
public class X {
void f(String name, Object[] args) {
}
void f(Object l, Object r) {
}
public static class Y extends X {
void f(Object l, Object r) {
}
}
public static class Z extends Y {
void f(String name, Object[] args) {
super.f(name, args);
}
}
}
//----------------------
Compiles fine under 1.4+ modes, but not in 1.3 compliance.
It has been this way for some time.
javac -source 1.3 accepts this.
I'll take a look.
It's obviously not marked as FIXED, so this should come as no shock: Still observing this in 1.4.2.20120213-0813 after an update. :( Any update? This blocks people from going to indigo. (In reply to comment #4) > Any update? This blocks people from going to indigo. Are you sure you are hitting this very same bug ? Per comment#2, this affects only 1.3 mode - Are you on 1.3 ? Just an update: still observable in: Version: Juno Release Build id: 20120614-1722 Updated to note the latest affected release: 4.2.1. Just updated to: Version: Juno Service Release 1 Build id: 20121004-1855 Compiler still gives the same error. Sorry, have been too busy with Java 8 work in the last couple of years. Sasi, please take it forward. Just tried to build Jenkins Git-plugin (https://github.com/jenkinsci/git-plugin.git) and got this error. Version: Mars.1 Release (4.5.1) Build id: 20150924-1200 JDK I've tried several. Seems a shame this defect has been outstanding going on 4 years, and there is a popular open source project (jenkins git-plugin) that experiences this issue. I would vote to escalate this issue. FOR WHAT ITS WORTH, the git-plugin builds without error when built from command line using maven. (In reply to comment #9) > Just tried to build Jenkins Git-plugin > (https://github.com/jenkinsci/git-plugin.git) and got this error. > > Version: Mars.1 Release (4.5.1) > Build id: 20150924-1200 > > JDK I've tried several. > > Seems a shame this defect has been outstanding going on 4 years, and there is a > popular open source project (jenkins git-plugin) that experiences this issue. > > I would vote to escalate this issue. > > FOR WHAT ITS WORTH, the git-plugin builds without error when built from command > line using maven. I suspect if it's the same bug you are running into because this is seen only at 1.3 compliance and I saw 1.5 in the pom.xml for the jenkins git plugin. If you can give me instructions how to build the project to see the issue, we can sort it out. It's probably a misconfiguration of the eclipse compiler that leads it to believe the target is 1.3 where as you want to build it for 1.5 I did nothing special, clone the repo and import the project to eclipse. 1. in the eclipse git repository view, clone the project (https://github.com/jenkinsci/git-plugin.git) 2. after the clone is complete, select the new repository in the Git Repositories view, right-click and select the "import maven projects..." menu 3. after the import is complete (it took several minutes on my system) right-click the project in the package explorer (or whatever view you prefer) and click the maven->update project menu. 4. when the update is complete, and the automatic project build completes, you will see two errors in the problems view on the /git/src/test/java/hudson/plugins/git/GitSCMTest.java module. I made NO source changes. Open a terminal window, cd to the project and 'mvn compile' will report no errors. NOTE, as in the original report, my system is mac os x. I'm not sure if this issue exists in the Windows version of eclipse. I'm also getting the error on my Windows box, so it is unrelated to Mac OS X. Thanks for the steps Michael. I was able to reproduce the error and filed bug 485066 to track this issue as it is a totally different one from what's mentioned here. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Build Identifier: Indigo SR1 20110916-0149 Here is a single source file which has been modified from a project that compiles cleanly using: java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) Eclipse flags an error on line 39 (the line containing "super.call()") saying that the call is ambiguous: super.call(context, functionName, args); 'context' is a String, 'functionName' is a String, and 'args' is an Object[]. The compiler has two choices for methods this could match: public Object call(String context, String functionName, Object[] args) protected abstract Object call(String context, Object lvalue, Object rvalue) The correct match is the one with the more-specific types (String,String,Object[]) and Eclipse says that call(String,Object,Object) is ambiguous. Reproducible: Always Steps to Reproduce: Dump the attached file into an Eclipse project. This project has had its compiler compliance level set to "1.3".