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

Bug 117295

Summary: [clean up][infrastructure] Light clean up
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse, Konstantin.Scheglov, markus.kell.r, martinae
Version: 3.2   
Target Milestone: 3.2 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix none

Description Benno Baumgartner CLA 2005-11-21 05:51:12 EST
Version: 3.2.0
Build id: I20051116-1332

Light clean up means that when the clean up action is executed on a cu in an editor no refactoring wizard is shown. The clean ups which have been selected last time in the wizard are executed and applyed to the active cu without a preview/dialog. Users can assign a key combination to the clean up action and executed clean up by just pressing the key combination. The wizard is still shown when clean up is executed by selecting cus in the package explorer.

See also Bug 87537
Comment 1 Benno Baumgartner CLA 2005-11-21 05:53:13 EST
Created attachment 30303 [details]
fix

Patch does that. It also moves the default dialog setting settings away from the CleanUpWizard to the MultiFixes.
Comment 2 Konstantin Scheglov CLA 2005-11-21 06:04:01 EST
BTW, "Format" works on full CU when nothing is selected and only on selected part of CU if there is selection. Will "Clean Up" support such behaviour?
Comment 3 Benno Baumgartner CLA 2005-11-22 03:31:55 EST
We are not sure if it is realy usefull to clean up only parts of a cu. Say you have the 'add this qualifier' clean up activated, applying this clean up only on some parts of a cu will IMHO end up more in a mess up then a clean up. But if you have a convincing use case then file a enhancement request against jdt/ui.
Comment 4 Martin Aeschlimann CLA 2005-11-22 04:30:35 EST
patch releaseed > 20051122
Comment 5 Konstantin Scheglov CLA 2005-11-22 04:55:15 EST
1. I have several CU's on which several people are working. So, we own this CU not fully, but by method basis and format/style each method as we want.

2. This behaviour will be more consistent with Format. I think there were some reasons to support formatting only part of CU.

3. If we speak about 'add this qualifier', I have one question. Is there support for reverse operation? As I can see in 3.2 M3 there are no such operation. But what if I have CU with such code style and don't like it?
Comment 6 Benno Baumgartner CLA 2005-11-22 07:04:18 EST
(In reply to comment #5)
> 1. I have several CU's on which several people are working. So, we own this CU
> not fully, but by method basis and format/style each method as we want.

I think this is not the right approache in the first place. If several people are working on the same CU/Project they should agree on a code styling standart and therefore have all the same clean ups enabled. Otherwise the code will be a mess and having clean ups for selected regions will make it even worse. We are thinking about making clean up settings per project and put it into the .settings folder to allow to store the settings in cvs.

> 
> 2. This behaviour will be more consistent with Format. I think there were some
> reasons to support formatting only part of CU.

I think the exact same argument holds for Format.

> 
> 3. If we speak about 'add this qualifier', I have one question. Is there
> support for reverse operation? As I can see in 3.2 M3 there are no such
> operation. But what if I have CU with such code style and don't like it?
> 

There is no such clean up. It sounds reasonable but it may not be very easy to do that i.e.:
private int i;
void foo(int i) {this.i= i;}
the this qualifier can't be removed. But I'm sure there is a way to check that. If you want such a clean up then file an enhancement request against JDT/UI.