Community
Participate
Working Groups
Created attachment 191780 [details] screenshot of the problem In the screenshot attached, I have a field whose type is known. When I try to create a new instance to assign it to this variable, I think the first types being proposed for completion should be those assignable to InputStream.
This works in general. Maybe you've set the preference on Java > Editor > Content Assist to sort alphabetically? Maybe you use Mylyn which sorts differently? Can you provide a reproducible code snippet?
Ping.
.
Created attachment 192994 [details] screenshot (In reply to comment #1) > This works in general. hmm.. not really, see the screenshot. -------------------------------------------- import java.io.InputStream; class A { void foo() { InputStream is; is = new Byte<ctrl+space> } } -------------------------------------------- -------------------------------------------- import java.io.InputStream; class A { void foo() { InputStream is; is = new File<ctrl+space> } } -------------------------------------------- In both cases the first type proposed cannot be assigned to InputStream.
Reopening.
I see now. The problem was that I tried it in a class that already had some imports in that case those types are sorted on top. Before we had constructor completion the sorting was improved using the LRU type cache but that's currently not yet implemented for the constructor proposal (see bug 261315). That we fix the general case without LRU cache won't happen as it would be too expensive. *** This bug has been marked as a duplicate of bug 261315 ***