On Thu, 3 Jul 2025 09:53:30 GMT, Kieran Farrell <[email protected]> wrote:
>> src/java.base/share/classes/java/util/UUID.java line 212:
>>
>>> 210: * @since 26
>>> 211: */
>>> 212: public static UUID unixEpochTimeMillis() {
>>
>> Is there a list anywhere on the names that have been discussed already?
>> Asking because the existing static factory method for a type 4 is
>> randomUUID(). Also, there are several methods (esp. in java.time) that use
>> "Epoch" in method names name rather than "Unix Epoch". Also if you rename
>> the timestamp parameter to something that includes "millis" in the name then
>> it would help usage in IDEs where it's more obvious at the use-site that the
>> parameter is in millis.
>
> The original proposed name was `timestampUUID` but it was decided against to
> avoid confusion with UUID-v1, which is also time-based, there hasnt been much
> discussion beyond that. Maybe something like `epochMilliUUID()` would better
> follow the naming conventions?
>
> Reagarding the parameter, updating to something like `epochMillis` or
> `timestampMillis` would make sense.
The `UUID.epochMillis()` and `UUID.epochMillis(long timestamp)` is concise and
identifies both the Unix Epoch and the granularity of millis.
(Sorry for the long absence from this thread).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25303#discussion_r2323539314