Ostrzyciel opened a new pull request, #2796:
URL: https://github.com/apache/jena/pull/2796
GitHub issue resolved #2795
Pull request Description:
Fixed a race condition in user-defined datatype registration. I have
considered an alternative solution with `computeIfAbsent` in
`getSafeTypeByName`, but that would leave `registerDatatype` without the fix,
which I think would be inconsistent.
This change is (I think) backwards-compatible, because the registerDatatype
method is changed from returning void to RDFDatatype. The callers of this
method are mostly just static initializers and other stuff that will not care
about race conditions anyway, so we don't need to change these calls. Users
should not be using this method directly anyway, so we should be good on that
front as well.
I've added a short note to `unregisterDatatype` that it has good
"shoot-yourself-in-the-foot-with-a-bazooka" potential.
I've also added a test to ensure that `registerDatatype` is idempotent.
----
- [x] Tests are included.
- [x] Documentation change and updates are provided for the [Apache Jena
website](https://github.com/apache/jena-site/)
- [x] Commits have been squashed to remove intermediate development commit
messages.
- [x] Key commit messages start with the issue number (GH-xxxx)
By submitting this pull request, I acknowledge that I am making a
contribution to the Apache Software Foundation under the terms and conditions
of the [Contributor's
Agreement](https://www.apache.org/licenses/contributor-agreements.html).
----
See the [Apache Jena "Contributing"
guide](https://github.com/apache/jena/blob/main/CONTRIBUTING.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]