Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Help with ParameterizedQualifiedTypeReference

Hi,
I'm trying to fix Bug 462192, where the following happens.
Suppose we have a Java file,

    class Foo {
     void foo() { bar(null); }  // <----- resolveBinding() on `bar` is null
     static void bar(Clazz.Builder<?> b) { }
    }

Then the `bar(null)` on the 2nd line will fail to resolve.

Deleting the dot between Clazz and Builder causes everything to work again.

    class Foo {
     void foo() { bar(null); }  // <----- resolveBinding() on `bar` is non-null
     static void bar(ClazzBuilder<?> b) { } // <----- no dot
    }

I'd expect qualified and non-qualified types to behave the same. 
Is there a reason why we shouldn't resolve `bar` in the first case?

In ParameterizedQualifiedTypeReference.internalResolveLeafType, I tried returning 
`this.resolvedType.closestMatch()` instead of null 
(see https://git.eclipse.org/r/58779), but that causes a failure in 
CompletionWithMissingTypesTests_1_5.test0008.

Instead of the expected completion there, the completion engine returns nothing.

Anyone has experience with these classes and can help me figure this out?

Thanks!

Back to the top