Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332521 - [quick assist] Ctrl+1 on missing Javadoc is 'Rename in file' first which wouldn't actually fix the problem
Summary: [quick assist] Ctrl+1 on missing Javadoc is 'Rename in file' first which woul...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-14 09:03 EST by Remy Suen CLA
Modified: 2011-03-07 03:49 EST (History)
3 users (show)

See Also:


Attachments
Screenshot depicting the problem in question. (4.95 KB, image/png)
2010-12-14 09:03 EST, Remy Suen CLA
no flags Details
Screenshot depicting the behaviour in question. (6.83 KB, image/png)
2010-12-14 10:38 EST, Remy Suen CLA
no flags Details
Fix (7.15 KB, patch)
2011-02-23 12:03 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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