Skip to content

Conversation

@BradWalker
Copy link
Member

@BradWalker BradWalker commented Dec 18, 2025

cleanup: remove deprecated TheadGroup methods

desc: The ThreadGroup class is an artifact of by-gone days.

The ability to destroy a thread group and the concept of a destroyed thread group no longer exists. Several of the methods are null functions as well as marked for removal. This cleans up the usage of these methods.


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

@BradWalker BradWalker added this to the NB29 milestone Dec 18, 2025
@BradWalker BradWalker self-assigned this Dec 18, 2025
@BradWalker BradWalker added the Code cleanup Label for cleanup done on the Netbeans IDE label Dec 18, 2025
@mbien
Copy link
Member

mbien commented Dec 18, 2025

the Destroyer thread isn't doing anything now outside of sleeping in a loop. This would look confusing/misleading post cleanup unless usage of this functionality is handled too.

desc: The ThreadGroup class is an artificate of by-gone days. The ability to destroy a thread group and the concept of a destroyed thread group no longer exists. Several of the methods are null functions as well as marked for removal. This cleans up the usage of these methods.
@BradWalker BradWalker force-pushed the cleanup_threadgroup_method_usage branch from e36963a to 03a7951 Compare December 19, 2025 04:20
@BradWalker
Copy link
Member Author

the Destroyer thread isn't doing anything now outside of sleeping in a loop. This would look confusing/misleading post cleanup unless usage of this functionality is handled too.

I'm trying to broaden my work on Netbeans. So I was a little bit worried about doing more. Just kept my changes minimal. But, I agree wit you. The thread becomes "worthless" once this change is made. I cleaned up a few other things to make the code more useful.

Thanks for the comment.

Comment on lines -197 to +198
Iterator<ExecutionListener> iter = ((HashSet<ExecutionListener>) executionListeners.clone()).iterator();
Iterator<ExecutionListener> iter = executionListeners.iterator();
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes me nervous. Why is the removal of the clone safe? HashMaps are not synchronized and if I remember correctly iteration of a map that is modified by another thread is undefined behavior. The clone removes the need for synchronization (at least I would read it as such).

Copy link
Member Author

Choose a reason for hiding this comment

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

This makes me nervous. Why is the removal of the clone safe? HashMaps are not synchronized and if I remember correctly iteration of a map that is modified by another thread is undefined behavior. The clone removes the need for synchronization (at least I would read it as such).

Had to look into this more. You are correct. I updated this so that a synchronizedSet is used. This seems to be a better choice compared to making a copy of the Set. The code is cleaner and correct.

Good eyes. Thanks for catching this. I learned something here..

@BradWalker
Copy link
Member Author

closed as a duplicate of #9096..

@BradWalker BradWalker deleted the cleanup_threadgroup_method_usage branch December 21, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code cleanup Label for cleanup done on the Netbeans IDE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants