Bug 562374 - "Generate Getter and Setter" dialog does display grayed​ state incorrectly
Summary: "Generate Getter and Setter" dialog does display grayed​ state incorrectly
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.15   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-04-21 16:01 EDT by Dieter Mai CLA
Modified: 2020-05-04 04:12 EDT (History)
2 users (show)

See Also:


Attachments
Observed O3 (22.09 KB, image/png)
2020-04-21 16:01 EDT, Dieter Mai CLA
no flags Details
Expected E3 (22.22 KB, image/png)
2020-04-21 16:02 EDT, Dieter Mai CLA
no flags Details
PossibleFix (2.71 KB, patch)
2020-04-30 14:24 EDT, Dieter Mai CLA
no flags Details | Diff
PossibleFix2 (2.70 KB, patch)
2020-05-01 09:01 EDT, Dieter Mai CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dieter Mai CLA 2020-04-21 16:01:43 EDT
Created attachment 282527 [details]
Observed O3

The Dialog "Generate Getter and Setter" displays a tree with the fields of a class as root elements it the getter and setter as leafs. If only one of the methods of a field has its checked, the checkbox of the field should be in its intermediate/grayed​ state. This does not always work.

How to reproduce

[Preconditions]
[P1] Have an java file open with fields that don't have any getters and setters.

[Actions]
[A1] Select the menu Source -> "Generate Getters and Setters..."
[A2] Press the button "Select All"
[A3] Press the button "Select Getters"

[Observed]
[O1] Dialog "Generate Getters and Setters" opens.
[O2] All entries for the fields and their methods are displayed as fully checked.
[O3a] All entries for the getters are displayed as fully checked.
[O3b] All entries for the setters are displayed as un-checked.
[O3c] [NOK] All entries for the fields are displayed as un-checked.

[Expected]
[O3c] All entries for the fields are displayed as grayed​.
Comment 1 Dieter Mai CLA 2020-04-21 16:02:56 EDT
Created attachment 282528 [details]
Expected E3
Comment 2 Dieter Mai CLA 2020-04-21 16:04:44 EDT
Tested on
Version: 2020-03 (4.15.0)
Build id: 20200313-1211
Windows 10

did not test any other versions/systems.
Comment 3 Dieter Mai CLA 2020-04-29 16:59:11 EDT
I had a look at the source code and determined that this is not a JDT issue but an issue with the class ContainerCheckedTreeViewer in org.eclipse.ui.workbench. Due to that i moved it to Product: Platform.

It seems like the issue was introduced with the performance improvements for ticket 539724. 
The changes in ContainerCheckedTreeViewer#setCheckedElements assumed that the method super.setCheckedElements(elements) would only check elements but in fact it also un-checks some.
Comment 4 Andrey Loskutov CLA 2020-04-29 17:02:38 EDT
Michael, could you please check this?
Comment 5 Dieter Mai CLA 2020-04-30 14:24:03 EDT
Created attachment 282638 [details]
PossibleFix

I testes some changes and come up with this
Comment 6 Dieter Mai CLA 2020-05-01 09:01:55 EDT
Created attachment 282649 [details]
PossibleFix2

some small small improvements