Reputation: 2365
I'm a happy user of eclipse mars for some time. But there is one thing that bugs me a bit:
When i start eclipse mars in the morning and start typing for example:
list.add
(list is an arraylist)
Then the parameters are displayed as arg0 and arg1. This only happens the first time. Cause when i type "list.add" again the parameter names are displayed, so no arg0 and arg1 anymore.
But when i go to another class and use it by typing hash.put the parameters are arg0 again. But when i try it a second time the parameters names are correctly displayed, no more arg0 anymore.
I do have a jdk (1.8 60) with source configured and selected (installed jres and for the project).
First try, you'll get arg0:
Second try the param names:
Solved:
(thanks to francesco foresti for pointing me to the right direction)
Found it! Right click "jre system library", properties, select "execution env" radiobutton, click "environment" button , select "javase-18" and enable the checkbox for jdk in the "compatible jre" list. Now the rt.jar has source attachment instead of only javadoc attachment. And it keeps it even after a maven "update project".
Upvotes: 1
Views: 645
Reputation: 2043
Wild guessing here, so take this answer with a grain of salt..
It is possible that, the first time you ask for an autocomplete Eclipse fills up the parameter names using decompiled classes (coming from your project dependencies), hence you see arg0 arg1 and so on. At the same time Eclipse triggers a source download request (maybe to Maven, I don't know), so the next time you want an autocomplete, you see the parameters' real names. It also seems that this "autocomplete cache" has a limited lifetime, so that when you open Eclipse the next morning, it starts all over again. I'd suggest you try to dig into Eclipse autocomplete configuration if you want to change this behavior.
Upvotes: 2