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

Bug 339056

Summary: [quick assist][quick fix] The order of quick fix/quick assists is wrong sometimes
Product: [Eclipse Project] JDT Reporter: Raksha Vasisht <raksha.vasisht>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Raksha Vasisht CLA 2011-03-07 03:47:32 EST
N20110305-2000

Case 1 -  (bug 332521 comment #10)
--------
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)?

Test case 2:  (from bug 334992 comment# 7)
-----------
public class A {    
    int foo(){
        new StringBuffer();
        return 1;        
    }
}

=> I would expect that the 'Return the allocated Object' quick fix comes before
or after both the Assign quick assists.
Comment 1 Markus Keller CLA 2011-03-07 09:43:05 EST
> Case 1 -  (bug 332521 comment #10)
> a) Add all missing tags
> b) Assign parameter to new field
> c) Add '@param' tag 
> [..]
> ==> 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)?

I agree, fixed in JavadocTagsSubProcessor.


> Test case 2:  (from bug 334992 comment# 7)
> -----------
> public class A {    
>     int foo(){
>         new StringBuffer();
>         return 1;        
>     }
> }
> 
> => I would expect that the 'Return the allocated Object' quick fix comes before
> or after both the Assign quick assists.

Fixed in QuickAssistProcessor#getAssignToVariableProposals(..).
Comment 2 Raksha Vasisht CLA 2011-03-09 08:44:02 EST
Verified for 3.6 M6 with I20110307-2110.