Skip to content

Conversation

@mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Dec 5, 2025

The UniqueIdFormat is a singleton instance and not part of the public API, as such is effectively constant. Tracking the format in every UniqueId is unnecessary and makes the larger than it needs to be.

In 2016 in 0e5ab97 the UniqueId.uniqueIdFormat was added with the message:

  • UniqueId now tracks the UniqueIdFormat it was created with in order to avoid accidentally switching to the default format when appending new segments to an existing UniqueId.

But at the time UniqueIdFormat was public and not a singleton.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@testlens-app
Copy link

testlens-app bot commented Dec 5, 2025

✅ All tests passed ✅

🏷️ Commit: 94f1cd3
▶️ Tests: 38003 executed
⚪️ Checks: 15/15 completed

@mpkorstanje mpkorstanje force-pushed the rien/remove-unique-id-format-field branch from 1f740da to 3a4a33c Compare December 5, 2025 23:31
The `UniqueIdFormat` is a singleton instance and not part of the public
API, as such is effectively constant. Tracking the format in every
`UniqueId` is unnecessary and makes the larger than it needs to be.
@mpkorstanje mpkorstanje force-pushed the rien/remove-unique-id-format-field branch 2 times, most recently from dbaf57b to fa142fa Compare December 6, 2025 13:11
@mpkorstanje mpkorstanje force-pushed the rien/remove-unique-id-format-field branch from fa142fa to 94f1cd3 Compare December 6, 2025 13:15
@mpkorstanje
Copy link
Contributor Author

Open questions for team discussion:

  • Can we change the serial version of UniqueId?

@marcphilipp
Copy link
Member

Can we change the serial version of UniqueId?

We should do so in a minor release. We could work around this by introducing custom writeObject/readObject methods (like we used to have for TestIdentifier in 5.x) that write null and ignore any read value.

@mpkorstanje
Copy link
Contributor Author

mpkorstanje commented Dec 6, 2025

We should do so in a minor release. We could work around this by introducing custom writeObject/readObject methods

Did you mean that as a workaround for the limitation of releasing this in a minor release and as a condition for a patch release, or as a work around for changing the serial version and as a condition for a minor release rather than a major release? Or can this go into the next minor release without custom methods?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants