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

Bug 424088

Summary: [1.8][content assist] Incorrect choices displayed for arguments and body in lambda expression
Product: [Eclipse Project] JDT Reporter: Manoj N Palat <manoj.palat>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: srikanth_sankaran
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=424097
https://bugs.eclipse.org/bugs/show_bug.cgi?id=434181
Whiteboard: stalebug

Description Manoj N Palat CLA 2013-12-16 03:30:10 EST
interface I {
	public int foo(int x, int y) ;
}

public class X {
	public void bar() {
		I i = (x, /*here*/) -> x + y; /* statement */
	}
}

First Issue: Press <Ctrl-Space> before /*here*/; incorrect choices are displayed.

Second Issue: Replace the statement above with the one below:
		I i = (x, y) -> x + /* second issue */;

Press <Ctrl-Space> before the /* second issue */ comment. Alongwith legal choices, illegal ones including toString(), bar() etc are displayed.
Comment 1 Srikanth Sankaran CLA 2013-12-16 04:19:28 EST
*** Bug 424097 has been marked as a duplicate of this bug. ***
Comment 2 Manoj N Palat CLA 2013-12-16 04:41:48 EST
interface I {
	void foo();
}

class Y {
	void goo(I i) {};
}

public class X {
	public static void main(String[] args) {
		Y y = new Y();
		y.goo(() -> /*Press Ctrl-Space before this comment to get 'y' as a choice*/ );
	}
}

Maybe yet another case of second issue, but lambda in a parameter context
Comment 3 Srikanth Sankaran CLA 2014-01-07 08:50:29 EST
Retargetting to 4.4, will pull up to Java 8 GA if time permits.
Comment 4 Manoj N Palat CLA 2015-04-02 04:44:02 EDT
moving out of 4.5
Comment 5 Eclipse Genie CLA 2019-12-10 07:23:56 EST
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.