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
NamespacedHierarchicalStore
should fail on modifications after close
#3614
Comments
NamespacedHierarchicalStore
should fail on modifications after close
Thanks for raising the issue, @leonard84. I've slated this for 5.11 M1. Would you be interested in submitting a PR? |
Track the active/closed state in NamespacedHierarchicalStore so it can throw an IllegalStateException when doing a modification/query on it after it has been already closed. Make a close operation on an already closed store a no-op. Issue: junit-team#3614
Track the active/closed state in NamespacedHierarchicalStore so it can throw an IllegalStateException when doing a modification/query on it after it has been already closed. Make a close operation on an already closed store a no-op. Issue: junit-team#3614
Oops did not notice that this does not have an |
@mobounya Yes, feel free to do so! I've added the label now. |
Track the active/closed state in NamespacedHierarchicalStore so it can throw an IllegalStateException when doing a modification/query on it after it has been already closed. Make a close operation on an already closed store a no-op. Issue: junit-team#3614
Track the active/closed state in NamespacedHierarchicalStore so it can throw an IllegalStateException when doing a modification/query on it after it has been already closed. Make a close operation on an already closed store a no-op. Issue: junit-team#3614
Track the active/closed state in NamespacedHierarchicalStore so it can throw an IllegalStateException when doing a modification/query on it after it has been already closed. Make a close operation on an already closed store a no-op. Issue: junit-team#3614
The current implementation for tracking See: Lines 448 to 449 in 0ce27d2
I am therefore reopening this issue to address those two issues. |
Status Quo
The
NamespacedHierarchicalStore
doesn't track its state. Currently it is possible to callput()
or any other modifying action after the store has already been closed viaclose()
, allowing for potential misuse and bugs to creep in unknowingly.Proposal
Any modification or query after
close()
should result in anIllegalStateException
or similar. The methodclose()
should be idempotent: any subsequent call toclose()
should effectively be a no-op.Deliverables
NamespacedHierarchicalStore
tracks its active/closed stateNamespacedHierarchicalStore
throws an exception for modification or query calls after it has been closedNamespacedHierarchicalStore.close()
is idempotentThe text was updated successfully, but these errors were encountered: