Skip to content

Commit 5ed8add

Browse files
committed
Move FilteredTree parent assignment to abstract base class
The "parent" field is not set properly for the e4 FilteredTree and FilteredTable when using the protected constructor. Move the assignment to the common base class to avoid undesirable NullPointerExceptions. Amends 176f503
1 parent 2608e53 commit 5ed8add

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractFilteredViewerComposite.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public abstract class AbstractFilteredViewerComposite<T extends ViewerFilter> ex
8484
*/
8585
public AbstractFilteredViewerComposite(Composite parent, int style, long refreshJobDelayInMillis) {
8686
super(parent, style);
87+
this.parent = parent;
8788
this.refreshJobDelayInMillis = refreshJobDelayInMillis;
8889
}
8990

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/dialogs/FilteredTree.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ public class FilteredTree extends AbstractFilteredViewerComposite<PatternFilter>
135135
*/
136136
public FilteredTree(Composite parent, boolean useNewLook, boolean useFastHashLookup) {
137137
super(parent, SWT.NONE, DEFAULT_REFRESH_TIME);
138-
this.parent = parent;
139138
if (treeViewer != null) {
140139
treeViewer.setUseHashlookup(useFastHashLookup);
141140
}
@@ -180,7 +179,6 @@ public FilteredTree(Composite parent, int treeStyle, PatternFilter filter, boole
180179
public FilteredTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook,
181180
boolean useFastHashLookup, long refreshJobDelayInMillis) {
182181
super(parent, SWT.NONE, refreshJobDelayInMillis);
183-
this.parent = parent;
184182
init(treeStyle, filter);
185183
if (treeViewer != null) {
186184
treeViewer.setUseHashlookup(useFastHashLookup);
@@ -211,7 +209,6 @@ public FilteredTree(Composite parent, int treeStyle, PatternFilter filter, boole
211209
@Deprecated
212210
protected FilteredTree(Composite parent) {
213211
super(parent, SWT.NONE, DEFAULT_REFRESH_TIME);
214-
this.parent = parent;
215212
}
216213

217214
/**

0 commit comments

Comments
 (0)