-
Notifications
You must be signed in to change notification settings - Fork 913
cleanup: remove deprecated TheadGroup methods #9091
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
cleanup: remove deprecated TheadGroup methods #9091
Conversation
|
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.
e36963a to
03a7951
Compare
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. |
| Iterator<ExecutionListener> iter = ((HashSet<ExecutionListener>) executionListeners.clone()).iterator(); | ||
| Iterator<ExecutionListener> iter = executionListeners.iterator(); |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
clonesafe? 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..
|
closed as a duplicate of #9096.. |
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 -
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:
If this PR targets the delivery branch: don't merge. (full wiki article)