Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 486021

Summary: this() call is resolved binding to wrong constructor
Product: [Eclipse Project] JDT Reporter: Ivan Ivan <stoshins>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: register.eclipse
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:
Attachments:
Description Flags
Build to both files none

Description Ivan Ivan CLA 2016-01-18 04:18:37 EST
Created attachment 259232 [details]
Build to both files

Build the both files. Then open file Test.java, and call resolveConstructorBinding for this();

IMethodBinding for the same constructor will be given, but it's wrong, because they have different parameter sets.
Comment 1 Ivan Ivan CLA 2017-06-27 10:08:27 EDT
Any possibility that it will be fixed sometimes? I meet tons of wrong method/constructor binding resolutions every day
Comment 2 Till Brychcy CLA 2017-06-27 13:19:22 EDT
It might help if you provide a better problem description, esp. a complete, runnable test case.

From your description, I don't understand what the problem is, but I've had a quick look at the attached files.

Empty.java doesn't seem to be used by Test.java at all, is it needed?
Test.java contains references to missing classes, I assume this is intentional?

There is no argless constructor for Test, so there cannot be correct binding for it. 

I haven't tried, but I guess it is a ProblemMethodBinding or, a binding for the constructor with args as "best-match"?