Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE when opening quick type hierarchy twice #2002 #2005

Conversation

fedejeanne
Copy link
Contributor

@fedejeanne fedejeanne commented Feb 10, 2025

Fixes #2002

Changes

  • Introduce private method runWithVisited
  • Override expandToLevel(Object, int, boolean) and let it use runWithVisited

@fedejeanne
Copy link
Contributor Author

cc @jukzi

@fedejeanne fedejeanne marked this pull request as ready for review February 10, 2025 11:56
@jukzi jukzi added bug Something isn't working regression Regression defect labels Feb 10, 2025
@fedejeanne fedejeanne marked this pull request as draft February 10, 2025 12:25
@fedejeanne fedejeanne marked this pull request as ready for review February 10, 2025 12:26
Copy link
Contributor

@jukzi jukzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be less error prone to set and reset visited only in internalExpandToLevel if and only if visited==null when entered

@fedejeanne fedejeanne force-pushed the npe_quickt_type_hierarchy_twice branch from 219f093 to 25ad338 Compare February 10, 2025 13:15
@fedejeanne
Copy link
Contributor Author

Maybe it would be less error prone to set and reset visited only in internalExpandToLevel if and only if visited==null when entered

Something like

@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;
	}
}

?

@fedejeanne
Copy link
Contributor Author

Maybe it would be less error prone to set and reset visited only in internalExpandToLevel if and only if visited==null when entered

See #2006

@jukzi jukzi closed this Feb 10, 2025
@jukzi jukzi reopened this Feb 10, 2025
@fedejeanne
Copy link
Contributor Author

replaced by #2006

@fedejeanne fedejeanne closed this Feb 10, 2025
@fedejeanne fedejeanne deleted the npe_quickt_type_hierarchy_twice branch February 10, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Regression defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inplace type hierarchy throws exception in 2025-03
2 participants