Skip to content
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

Link to JDK 22 in Dokka output #977

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Documentation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fun AbstractDokkaLeafTask.applyKordDokkaOptions() {

dokkaSourceSets.configureEach {

jdkVersion = Jvm.target
jdkVersion = 22

suppressGeneratedFiles = false

Expand Down
15 changes: 8 additions & 7 deletions common/src/commonMain/kotlin/entity/Snowflake.kt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public class Snowflake : Comparable<Snowflake> {
*
* The comparison is based first on the value of the [timestamp], then on the value of the [workerId], then on the
* value of the [processId] and finally on the value of the [increment]. It is *consistent with equals*, as defined
* by [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html).
* by [Comparable](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Comparable.html).
*/
override fun compareTo(other: Snowflake): Int {
// the layout of Snowflake values from MSB to LSB is timestamp, workerId, processId, increment,
Expand Down Expand Up @@ -175,12 +175,13 @@ public class Snowflake : Comparable<Snowflake> {
* [processId] and [increment] are not taken into account.
*
* Note: this comparator imposes an ordering that is *inconsistent with equals*, as defined by
* [Comparator](https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html). It therefore shouldn't be
* used to order a [SortedSet](https://docs.oracle.com/javase/8/docs/api/java/util/SortedSet.html) or
* [SortedMap](https://docs.oracle.com/javase/8/docs/api/java/util/SortedMap.html). This is because
* `TimestampComparator` only compares the first 42 bits of the ULong [value] (comparing the timestamp), whereas
* [equals][Snowflake.equals] compares all the bits of the [value]. `TimestampComparator` can return `0` even if
* [equals][Snowflake.equals] returns `false`, but [equals][Snowflake.equals] only returns `true` if
* [Comparator](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Comparator.html). It
* therefore shouldn't be used to order a
* [SortedSet](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/SortedSet.html) or
* [SortedMap](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/SortedMap.html). This is
* because `TimestampComparator` only compares the first 42 bits of the ULong [value] (comparing the timestamp),
* whereas [equals][Snowflake.equals] compares all the bits of the [value]. `TimestampComparator` can return `0`
* even if [equals][Snowflake.equals] returns `false`, but [equals][Snowflake.equals] only returns `true` if
* `TimestampComparator` returns `0`.
*/
public val TimestampComparator: Comparator<Snowflake> = Comparator { s1, s2 ->
Expand Down