| Summary: | Getter and Setter in Name Style preview can differ from generated code | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Marc-André Laperle <malaperle> | ||||||
| Component: | cdt-refactoring | Assignee: | Marc-André Laperle <malaperle> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Emanuel Graf <emanuel> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cdtdoug, eclipse.sprigogin, scobido1984 | ||||||
| Version: | 8.0 | ||||||||
| Target Milestone: | 8.0.1 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Marc-André Laperle
Created attachment 199790 [details]
Trim seed name for getters and setters
In NameStyleBlock.Category.composeExampleName, the name passed to NameComposer needs to be trimmed for the cases of getters and setters as it is done inside GetterSetterNameGenerator. That means calling GetterSetterNameGenerator.trimFieldName from NameStyleBlock which doesn't seem ideal. I think trimFieldName should be moved to NameComposer (and be renamed to trimSeedName?). I could see other cases where we would want to trim the seed name. For example, Generate Constructor (bug 306902 WIP) also calls trimFieldName to generate parameter names. Sergey, what do you think? (In reply to comment #2) > In NameStyleBlock.Category.composeExampleName, the name passed to NameComposer > needs to be trimmed for the cases of getters and setters as it is done inside > GetterSetterNameGenerator. That means calling > GetterSetterNameGenerator.trimFieldName from NameStyleBlock which doesn't seem > ideal. I think trimFieldName should be moved to NameComposer (and be renamed to > trimSeedName?). I could see other cases where we would want to trim the seed > name. For example, Generate Constructor (bug 306902 WIP) also calls > trimFieldName to generate parameter names. Sergey, what do you think? I agree with moving. The name of the method should still contain the word "Field" since in future we may need other seed trimming methods. *** Bug 350948 has been marked as a duplicate of this bug. *** Created attachment 199803 [details]
Trim seed name for getters and setters, trimFieldName moved
Fixed in cdt_8_0 and master > 20110719. *** cdt git genie on behalf of 352257 ***
Bug 352257 - Getter and Setter in Name Style preview can differ from
generated code
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=0c0e19f36e881efcd52702d88262d46d9064fc85
*** cdt git genie on behalf of 352257 ***
Bug 352257 - Getter and Setter in Name Style preview can differ from
generated code
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=601fae9798ef7ca1020b04da62ea671fb8d4ff83
|