Skip to content

Commit

Permalink
Fix NPE when opening quick type hierarchy twice #2002
Browse files Browse the repository at this point in the history
Fixes #2002
  • Loading branch information
fedejeanne authored and jukzi committed Feb 10, 2025
1 parent cb33fee commit ce62c65
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,20 @@ protected TreeViewer createTreeViewer(Composite parent, int style) {
TreeViewer treeViewer= new TreeViewer(tree) {
private Set<Object> visited;

@Override
protected void inputChanged(Object input, Object oldInput) {
visited= new HashSet<>();
super.inputChanged(input, oldInput);
visited= null;
}

@Override
protected void internalExpandToLevel(Widget node, int level) {
boolean reset = false;
if (visited == null) {
reset = true;
visited = new HashSet<>();
}
if (!shouldExpand(node))
return;

super.internalExpandToLevel(node, level);
if (reset) {
visited = null;
}
}

private boolean shouldExpand(Widget widget) {
Expand Down

0 comments on commit ce62c65

Please sign in to comment.