Fix rare CCE in the interface selector UI of the new-java-class wizard#9050
Merged
mbien merged 1 commit intoapache:masterfrom Dec 1, 2025
Merged
Fix rare CCE in the interface selector UI of the new-java-class wizard#9050mbien merged 1 commit intoapache:masterfrom
mbien merged 1 commit intoapache:masterfrom
Conversation
mbien
commented
Nov 30, 2025
Comment on lines
501
to
505
| final Models.MutableListModel baseModel = Models.mutable( | ||
| final Models.MutableListModel<TypeDescriptor> baseModel = Models.mutable( | ||
| ic, | ||
| currentSearch.resetFilter(), | ||
| null); | ||
| final ListModel model = typeFilter != null ? | ||
| FilteredListModel.create(baseModel, new FilterAdaptor(typeFilter), NbBundle.getMessage(GoToTypeAction.class, "LBL_Computing")) : | ||
| @SuppressWarnings("unchecked") | ||
| final ListModel<TypeDescriptor> model = typeFilter != null ? | ||
| FilteredListModel.create(baseModel, new FilterAdaptor(typeFilter), null) : | ||
| baseModel; |
Member
Author
There was a problem hiding this comment.
this was what passed a String into the model + replaced the typed model with it a few lines later. The initial value is now null since it wouldn't show up anyway.
matthiasblaesing
approved these changes
Nov 30, 2025
Contributor
matthiasblaesing
left a comment
There was a problem hiding this comment.
Looks sane to me. You might want to consider generifying FilteredListModel. Only compile checked this, but it shows the idea: 3444f2d.
The code replaced a typed ListModel with a dummy model containing a single String which can cause a CCE in the interface selector filter. The dummy model isn't really needed since the goto component does handle the "search in progress" state already, so I removed the default value. Fixed more rawtype compiler warnings to avoid similar issues in future.
Member
Author
|
had some of it in my stash already but wasn't sure if i should add it here. Will add it with a few more rawtype fixes in the related files. |
3e45a18 to
b2ad041
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code replaced a typed
ListModelwith a dummy model containing a single String which can sometimes cause a CCE in the interface selector filter.The dummy model isn't really needed since the goto component does handle the "search in progress" state already, so I removed it.
Fixed more
rawtypecompiler warnings to avoid similar issues in future.exception:
Details
reproduce:
open new java class wizard, and use the interfaces filter (browse button) often enough until the exception occurs.
regression since #8896