Community
Participate
Working Groups
I20090518-2000 Constructor completion does not work for constructor with parameter in generic type from another package To reproduce, invoke content assist after 'new Stu'. I only get a proposal for the no-arg constructor. Same problem if class Stuff is abstract. Works fine if a.Stuff is already imported or is in the same package. //--------- package p; public class C { public static void main(String[] args) { new Stu } } //--------- package a; import java.util.List; public class Stuff<E> { public Stuff(E e) {} // public Stuff(Object o) {} // public Stuff(List<E> ees) {} // public Stuff() {} // only this one works }
Nothing coming back from completion engine.
Created attachment 136486 [details] Proposed patch When the constructor has parameters, CompletionEngine#getResolvedSignature() computes the binding of the declaring type from the type name. If the type is generic then a RawTypeBinding is computed and getResolvedSignature() assumed that this binding was a SourceTypeBinding. The erasure of the computed binding must be used instead.
Olivier, could review the patch ?
Kent, could you review the patch ?
+1. Patch looks good.
Released for 3.5RC2. Tests added CompletionTests2#testBug276890_01() -> testBug276890_03()
Verified in I20090520-2000.