Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315363 - [encapsulate field] Encapsulate Field quickfix generate getter and setter in the wrong order
Summary: [encapsulate field] Encapsulate Field quickfix generate getter and setter in ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Raksha Vasisht CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 05:42 EDT by pihentagy+eclipse+bugzilla CLA
Modified: 2010-08-03 13:58 EDT (History)
3 users (show)

See Also:


Attachments
Test fixes (28.83 KB, patch)
2010-06-18 09:05 EDT, Raksha Vasisht CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pihentagy+eclipse+bugzilla CLA 2010-06-02 05:42:17 EDT
Build Identifier: 20100218-1602

Two ways of generating getters and setters generate them in different order, and cannot configure them to produce it in the same order.

Reproducible: Always

Steps to Reproduce:
1. Create a protected field
2. Ctrl+1 on the field 
3. Create getter and setter
RESULT: set... and get... methods in that order 

1. Create a protected field
2. Right click - Source - Generate getters and setters
RESULT: get... and set... methods in  that order (and cannot modify the order)
Comment 1 Olivier Thomann CLA 2010-06-02 06:47:55 EDT
Move to JDT/UI
Comment 2 Markus Keller CLA 2010-06-02 10:42:59 EDT
The quick fix is the same as Refactor > Encapsulate Field. I agree that this should create the getter first.

Raksha, could you please have a look? Remember to adjust the tests as well.
Comment 3 Raksha Vasisht CLA 2010-06-17 14:03:05 EDT
(In reply to comment #2)
> The quick fix is the same as Refactor > Encapsulate Field. I agree that this
> should create the getter first.
> 
> Raksha, could you please have a look? Remember to adjust the tests as well.

Fixed in HEAD.
Comment 4 Raksha Vasisht CLA 2010-06-18 06:15:02 EDT
(In reply to comment #3)

> Fixed in HEAD.

Fixed in these files :
org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring
org.eclipse.jdt.ui.tests.quickfix.GetterSetterQuickFixTest
Comment 5 Raksha Vasisht CLA 2010-06-18 09:05:16 EDT
Created attachment 172213 [details]
Test fixes

More tests fixed and released to HEAD.
Comment 6 Deepak Azad CLA 2010-08-03 13:58:22 EDT
Verified with I20100802-1800 on Ubuntu.