Commit 248c577
Fix uniqueThenTime to use most significant bits for time ordering
The previous implementation used the lower 44 bits of timeCounterBits,
which only contained the lower 24 bits of the millisecond timestamp.
This caused time wrapping every ~4.66 hours, breaking lexicographical
sorting.
Now uses the most significant 44 bits (timeCounter >> 20) to preserve
long-term time ordering as intended.
Co-authored-by: simbo1905 <322608+simbo1905@users.noreply.github.com>1 parent 850b49c commit 248c577
File tree
1 file changed
+3
-2
lines changed- json-java21/src/main/java/jdk/sandbox/demo
1 file changed
+3
-2
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
0 commit comments