Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Autocomplete function return value
Autocomplete function return value [message #1765015] Mon, 05 June 2017 17:17 Go to next message
lac troi is currently offline lac troiFriend
Messages: 1
Registered: June 2017
Junior Member

let's say that I invoked Content Assist (Ctrl+Space) on some object.
I scroll through list of methods and choose some which returns a value.
the following code appears in my source editor:


However if function returns some complicated value with many generics, I would be convenient if eclipse could read function signature and automatically generate field to which function return value is assigned,
ie I would like the following code to appear in my code editor:

Map<Long,List<String>> field = object.someFunctionReturningValue

Is there any way how to achieve this?

Thank you
Re: Autocomplete function return value [message #1765201 is a reply to message #1765015] Wed, 07 June 2017 13:37 Go to previous message
Lucio Menci is currently offline Lucio MenciFriend
Messages: 2
Registered: June 2017
Junior Member
I hope that you can write the field name...

Write this:
field = object.someFunctionReturningValue();

Eclipse will sign the field field as an error. Press Ctrl + , to find it, then F2 and Enter to accept the Create local variable sudgestion.
Previous Topic:ejc failing to build with StackOverflowError
Next Topic:data flow analysis using the JDT infrastructure
Goto Forum:

Current Time: Sat Oct 20 13:05:52 GMT 2018

Powered by FUDForum. Page generated in 0.01345 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top