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

Bug 326690

Summary: Parameter names for constructors not fetched from Javadoc
Product: [Eclipse Project] JDT Reporter: Alekseev V. <alexkselk>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, daniel_megert, Olivier_Thomann, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Alekseev V. CLA 2010-09-30 12:04:26 EDT
Build Identifier: 20100617-1415

I have realy fast internet connection.
But when i use autocomplete, some code generating or refactoring eclipse use to write arg0, arg1 and so on instead real parmeters names. As i see, it is because it is not waiting untill javadoc is downloaded (even when it is milliseconds on my connection). It is realy anonying. It is especially cool, when developing some ui -- method whith 5 ints.
I know, i know, i can attach javadoc and sources localy, but i see no reason to use localy somethin available in the web.

Reproducible: Sometimes

Steps to Reproduce:
1. attach online javadoc instad local one
2. Use autocomplete on some coomon class, which documentation is not cached localy.
3. "Engoy" arg0, arg1 and arg2.
Comment 1 Dani Megert CLA 2010-10-01 02:09:00 EDT
You can increase the timeout on the Java > Editors > Content Assist > Advanced preference page.
Comment 2 Alekseev V. CLA 2010-11-05 03:16:08 EDT
I've tryed different values of timeout from 1 to 5000, but found no diferencies at all. For example, when i use 5000 (which means 5 seconds!) autocomplete steel appears immidiately witn agrN instead trying to get javadoc for five seconds and show popup only after successfully getting it or 5 seconds passed.
Comment 3 Dani Megert CLA 2010-11-05 03:30:45 EDT
(In reply to comment #2)
> when i use 5000 (which means 5 seconds!) autocomplete
> steel appears immidiately witn agrN instead trying to get javadoc for five
> seconds and show popup only after successfully getting it or 5 seconds passed.
OK, then there might be a different problem. Please attach a step by step test case, otherwise I can't do anything since I cannot reproduce the problem.
Comment 4 Alekseev V. CLA 2010-11-05 03:57:26 EDT
I'll try my best. But if it will be not enough i'll gladly answer more questions.

1) First of all i need to use some classes or members i have not used fiew time before (in my last case, when i decided to reopen bug, it was javax.swing.JLabel).

2) Then i make autocomplete to appear (type "label." and then "Ctrl+Space"). And i try to access, for example, setText. I type "setTe" and i see only one option in popup "setText(String arg0)". 

3) I WTF, but then i move cursor on this line of popup, wait for javadoc to pop up rightwards and then exit popup pressing "ESC" (first pressing "ESC" and then accessing javadoc via "F2" is also an option for me). 

4) now when i try "label." -> "Ctrl+Space" -> "setTe" everything is ok -- i see "setText(String text)";

of course it is not the great problem for setText, but, for example, "new Insets(int arg0, int arg1, int arg2, int arg3)", when there is no way to determinate which of them is left inset, which is right and so on is the real problem.
Comment 5 Dani Megert CLA 2010-11-08 08:36:36 EST
Are you still using 20100617-1415 or a new build?

Using 3.6 and 3.6.1 I cannot reproduce the problem i.e. I always get the expected parameter names. Without more detailed reproducible steps there's nothing I can do here.
Comment 6 Dani Megert CLA 2010-11-08 08:44:20 EST
(In reply to comment #5)
> Are you still using 20100617-1415 or a new build?
I'm asking because a new bug got introduced in 3.7 M2 and M3 which caches the raw parameter names (see bug 329671).
Comment 7 Dani Megert CLA 2010-11-08 09:33:34 EST
OK, I figured it out: parameter names for constructors are broken if the type is not yet imported.

Test Case:
0. remove source attachment from rt.jar
1. paste the following snippet into Package Explorer:
------ %< ------
class ParamNameBug {
	void foo() {
		new String
	}
}
------ %< ------
2. code assist after "new String"
==> no parameter names
Comment 8 Dani Megert CLA 2010-11-08 09:49:50 EST
Q: is hasNoParameterNamesFromIndex needed at all? If so, why is it needed?
Comment 9 Alekseev V. CLA 2010-11-08 20:10:23 EST
(In reply to comment #8)
> Q: is hasNoParameterNamesFromIndex needed at all? If so, why is it needed?

sorry what is hasNoParameterNamesFromIndex?(In reply to comment #6)


> (In reply to comment #5)
> > Are you still using 20100617-1415 or a new build?
> I'm asking because a new bug got introduced in 3.7 M2 and M3 which caches the
> raw parameter names (see bug 329671).

this bug looks exactly the same as mine.
Comment 10 Dani Megert CLA 2010-11-09 02:51:30 EST
>sorry what is hasNoParameterNamesFromIndex?(In reply to comment #6)
This is a field and the question is for the developer that has to investigate the issue. Nothing you need to worry about ;-)
Comment 11 Eclipse Genie CLA 2020-01-06 13:24:12 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.