Bug 568818 - Eclipse couldn't suggest lambda code completion
Summary: Eclipse couldn't suggest lambda code completion
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.9   Edit
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Gayan Perera CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-15 06:32 EST by Graeme Geldenhuys CLA
Modified: 2021-02-11 04:31 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graeme Geldenhuys CLA 2020-11-15 06:32:12 EST
It seems that Eclipse can't suggest a lambda expression or lambda code block where a functional interfaces could be used. For example, in the code snippet below, Eclipse couldn't suggest any code completion for the clip.addLineListener(). A competing Java IDE had no problem suggesting a lambda while my cursor was between the parenthesis.

==========
			Clip clip = AudioSystem.getClip();
			// Open audio clip and load samples from the audio input stream.
			clip.open(audioIn);
			clip.start();
			// Listen for STOP event so we can close the clip, otherwise we will run out of resources
			clip.addLineListener(event -> {
				if (event.getType().equals(LineEvent.Type.STOP)) {
					clip.close();
				}
			});
==========

-- Configuration Details --
Product: Eclipse IDE 4.17.0.20200910-1200 (org.eclipse.epp.package.java.product)Installed Features:
 org.eclipse.jdt 3.18.500.v20200902-1800
Versioning Plugin:
 org.eclipse.platform 4.17.0.v20200902-1800
Comment 1 Lars Vogel CLA 2021-02-11 04:31:32 EST
Gayan, can you have a look? Maybe similar to what you did in http://dl.bintray.com/gayanper/p2/gap.eclipse.plugins/?