| Summary: | [assist] Completion engine should disambiguate ambiguous field access through multiply inherited interfaces | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | ANIRBAN CHAKRABORTY <anchakrk> | ||||
| Component: | Core | Assignee: | ANIRBAN CHAKRABORTY <anchakrk> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | anchakrk, srikanth_sankaran | ||||
| Version: | 4.3 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
Created attachment 233551 [details]
Patch for the fix
Patch for the fix
(1) With the patch applied, I get an NPE when completing below:
interface Foo {
int run1(int s1, int s2);
static int x2 = 0;
}
interface AnotherFoo {
int run1(int s1, int s2);
static int x2 = 0;
}
interface X extends Foo, AnotherFoo{
int x = x
// static Foo f = (x5, x6) -> x
int y = x|
}
(2) Why is it OK to not do the disambiguation when findFields is called
through
findFieldsAndMethods(char[], TypeBinding, Scope, ObjectVector, ObjectVector, InvocationSite, Scope, boolean, boolean, Binding[], int[], int[], boolean, char[], int, int)
findFieldsAndMethodsFromStaticImports(char[], Scope, InvocationSite, Scope, boolean, boolean, ObjectVector, ObjectVector, ObjectVector, boolean, boolean)
findMembers(char[], ReferenceBinding, Scope, InvocationSite, boolean, Binding[], int[], int[], boolean)
The review comments have been unattended to for nearly 4 months now. Please take a look, This is not a Java 8 issue. Nor or the proposals incorrect, though we could upfront offer suitably qualified proposals to disambiguate. Resetting target. See that same problem exists without lambda:
// --
interface Foo {
int run1(int s1, int s2);
static int x2 = 0;
}
interface AnotherFoo {
int run1(int s1, int s2);
static int x2 = 0;
}
interface X extends Foo, AnotherFoo{
static int x = x|
}
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. |
public interface Foo { int run1(int s1, int s2); static int x2 = 0; } interface AnotherFoo { int run1(int s1, int s2); static int x2 = 0; } interface X extends Foo, AnotherFoo{ static Foo f = (x5, x6) -> x<ctrl-space> } Here both Foo.x2 and AnotherFoo.x2 are suggested. But when you select them, for one, only x2 is printed. For other X.x2 is getting printed. Both cases give compiler error as ambiguous x2. Thanks Anirban