| Summary: | [quick assist] Create getter/setter doesn't respect field access under some conditions when just one getter/setter is created | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Roland Grunberg <rgrunber> |
| Component: | UI | Assignee: | Kenneth Styrberg <kenneth> |
| Status: | VERIFIED FIXED | QA Contact: | Roland Grunberg <rgrunber> |
| Severity: | normal | ||
| Priority: | P3 | CC: | kenneth, tobias_widmer |
| Version: | 4.12 | ||
| Target Milestone: | 4.12 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/140529 https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=e4738e9a11af9e88998afc33430c33d179e103a0 |
||
| Whiteboard: | |||
| Bug Depends on: | 232920 | ||
| Bug Blocks: | |||
@Kenneth, could you have a look at this ? There are just some corner cases to address. I'll check New Gerrit change created: https://git.eclipse.org/r/140529 Gerrit change https://git.eclipse.org/r/140529 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=e4738e9a11af9e88998afc33430c33d179e103a0 Thanks again for taking this. Verified for 4.12 M3 using I20190522-0600 build |
1) Use the following snippet package test; public class Test { private String myField; public void test() { myField += 10; } } 2) Trigger the quick-assist to 'create getter and setter for myField ...' 3) Disable setter creation via the checkbox, leaving the getter to be created, and ensure field access in declaring type is set to 'use getter and setter'. Then click ok. (Also if you click preview it generates an error but still allows you to apply the change) The getter is created as expected, but 'myField += 10;' remains the same. It would be expected for that statement to change to 'myField = getMyField() + 10;'