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

Bug 332521

Summary: [quick assist] Ctrl+1 on missing Javadoc is 'Rename in file' first which wouldn't actually fix the problem
Product: [Eclipse Project] JDT Reporter: Remy Suen <remy.suen>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert, markus.kell.r, raksha.vasisht
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot depicting the problem in question.
none
Screenshot depicting the behaviour in question.
none
Fix none

Description Remy Suen CLA 2010-12-14 09:03:42 EST
Created attachment 185130 [details]
Screenshot depicting the problem in question.

I20101208-1300 (3.7)

1. Have your compiler preferences set to warn/error out with missing/malformed Javadoc.
2. Declare a method that throws an exception.
3. Try to use Ctrl+1 to fix your javadoc, the first proposal is 'Rename in file' which is not really helpful.

Please see attached.
Comment 1 Dani Megert CLA 2010-12-14 10:29:54 EST
The Rename proposals are always on top by design since they are most often used.
Comment 2 Remy Suen CLA 2010-12-14 10:34:52 EST
(In reply to comment #1)
> The Rename proposals are always on top by design since they are most often
> used.

By "always" you mean for Javadoc cases?
Comment 3 Dani Megert CLA 2010-12-14 10:35:46 EST
(In reply to comment #2)
> (In reply to comment #1)
> > The Rename proposals are always on top by design since they are most often
> > used.
> 
> By "always" you mean for Javadoc cases?
No, always ;-)
Comment 4 Remy Suen CLA 2010-12-14 10:38:47 EST
Created attachment 185142 [details]
Screenshot depicting the behaviour in question.

(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > The Rename proposals are always on top by design since they are most often
> > > used.
> > 
> > By "always" you mean for Javadoc cases?
> No, always ;-)

I must be misinterpreting your statement then because that isn't always at the top for me. Please see attached.
Comment 5 Dani Megert CLA 2010-12-14 10:44:08 EST
(In reply to comment #4)
> Created an attachment (id=185142) [details] [diff]
> Screenshot depicting the behaviour in question.
> 
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (In reply to comment #1)
> > > > The Rename proposals are always on top by design since they are most often
> > > > used.
> > > 
> > > By "always" you mean for Javadoc cases?
> > No, always ;-)
> 
> I must be misinterpreting your statement then because that isn't always at the
> top for me. Please see attached.

Mmh, indeed. Looks like we only do this at some places, e.g. variable declarations.

Reopening to either adjust the other cases or fix the Javadoc case.
Comment 6 Remy Suen CLA 2010-12-14 10:45:06 EST
Note that the order has been adjusted before, see bug 283697.
Comment 7 Markus Keller CLA 2011-02-23 12:03:43 EST
Created attachment 189618 [details]
Fix

We have a general problem with the relevance of Quick Assist proposals that also show up when there's a warning or error around the selection.

Quick Fixes are generally more tailored to the actual problem than Quick Assists (Rename, Extract *).

I will lower the relevance of Quick Assists in such cases.
Comment 8 Markus Keller CLA 2011-02-23 12:04:10 EST
Fixed in HEAD.
Comment 9 Dani Megert CLA 2011-03-02 06:31:01 EST
Verified in I20110301-1537. Works nicely!
Comment 10 Raksha Vasisht CLA 2011-03-07 02:35:49 EST
The fix still shows quick assists ahead of quick fixes sometimes :

public class A {
	
	/**
	 * blah blah
	 *
	 */
	void boo(int ti){
		
	}
}

1. Have your compiler preferences set to warn/error out with missing/malformed
Javadoc.
2. Ctrl +1 shows :

a) Add all missing tags
b) Assign parameter to new field
c) Add '@param' tag 
d) Rename ...
e) Rename..

==> Shouldn't (c) come before (b) since it solves the problem and here since I clicked on a param I could also be looking for (c) rather than (a)?
Comment 11 Raksha Vasisht CLA 2011-03-07 03:49:35 EST
(In reply to comment #10)

See bug 339056