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

Bug 396595

Summary: InternalCompletionContext returns method key as expected type key for generic arguments
Product: [Eclipse Project] JDT Reporter: Sven Amann <info>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: jarthana, marcel.bruch
Version: 4.2.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard: stalebug

Description Sven Amann CLA 2012-12-14 05:32:39 EST
When triggering code completion at $ in

> java.util.Arrays.asList(x$)

the InternalCompletionContext returns [Ljava.util.Arrays;.asList() as an expected type key. The behaviour can be observed whenever completion is triggered in a parameter list, on the position of an argument of generic type.
Comment 1 Jay Arthanareeswaran CLA 2012-12-14 11:58:09 EST
On master, I see this:
Ljava/util/Arrays;.asList<T:Ljava/lang/Object;>(TT;)

What JDK do you have in your classpath? Can you try and put this in a small project where I can reproduce this locally? TIA!
Comment 2 Sven Amann CLA 2012-12-21 09:02:46 EST
I'm running with jdk1.7.0_06 on OSX.

Seems like something changed on master, but your result is no valid type key either, is it? Maybe I've got a wrong idea of type keys, but I'd expect something identifying the expected argument type here, which would be something like [Ljava/lang/Object; or [T or TT;.

If there's still need for it: could you give me a hand building a small project to reproduce the problem? From what i see, I'd have to create a bundle that's hooked into code completion and retrieves the type key (what you obviously already reproduced, since you've got your output) and a project with a code snipped to trigger completion in. Is there a way I could write say a test case for the InternalCompletionContext showing the problem?
Comment 3 Jay Arthanareeswaran CLA 2012-12-31 05:34:38 EST
(In reply to comment #2)
> I'm running with jdk1.7.0_06 on OSX.
> 
> Seems like something changed on master, but your result is no valid type key
> either, is it? Maybe I've got a wrong idea of type keys, but I'd expect
> something identifying the expected argument type here, which would be
> something like [Ljava/lang/Object; or [T or TT;.

May be this got fixed along with some other bug. I don't know yet. And if you are particular about the format you mentioned, you can use the InternalCompletionContext#expectedTypesSignatures.
Comment 4 Eclipse Genie CLA 2019-10-27 04:53:09 EDT
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.

If you have further information on the current state of the bug, please add it. 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.