Skip to content

Commit 77b559c

Browse files
committed
chore: change all '>>' to '>>>'
1 parent 49d4146 commit 77b559c

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/main/java/io/github/honhimw/uuid/Bytes.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ public String toString() {
212212
/// @param value value
213213
/// @return next index
214214
public static int putInt(byte[] dist, int index, int value) {
215-
dist[index] = (byte) (value >> 24);
216-
dist[index + 1] = (byte) (value >> 16);
217-
dist[index + 2] = (byte) (value >> 8);
215+
dist[index] = (byte) (value >>> 24);
216+
dist[index + 1] = (byte) (value >>> 16);
217+
dist[index + 2] = (byte) (value >>> 8);
218218
dist[index + 3] = (byte) value;
219219
return index + 4;
220220
}
@@ -226,7 +226,7 @@ public static int putInt(byte[] dist, int index, int value) {
226226
/// @param value value
227227
/// @return next index
228228
public static int putShort(byte[] dist, int index, short value) {
229-
dist[index] = (byte) (value >> 8);
229+
dist[index] = (byte) (value >>> 8);
230230
dist[index + 1] = (byte) value;
231231
return index + 2;
232232
}
@@ -238,13 +238,13 @@ public static int putShort(byte[] dist, int index, short value) {
238238
/// @param value value
239239
/// @return next index
240240
public static int putLong(byte[] dist, int index, long value) {
241-
dist[index] = (byte) (value >> 56);
242-
dist[index + 1] = (byte) (value >> 48);
243-
dist[index + 2] = (byte) (value >> 40);
244-
dist[index + 3] = (byte) (value >> 32);
245-
dist[index + 4] = (byte) (value >> 24);
246-
dist[index + 5] = (byte) (value >> 16);
247-
dist[index + 6] = (byte) (value >> 8);
241+
dist[index] = (byte) (value >>> 56);
242+
dist[index + 1] = (byte) (value >>> 48);
243+
dist[index + 2] = (byte) (value >>> 40);
244+
dist[index + 3] = (byte) (value >>> 32);
245+
dist[index + 4] = (byte) (value >>> 24);
246+
dist[index + 5] = (byte) (value >>> 16);
247+
dist[index + 6] = (byte) (value >>> 8);
248248
dist[index + 7] = (byte) value;
249249
return index + 8;
250250
}

src/main/java/io/github/honhimw/uuid/UuidBuilder.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ public static UuidBuilder fromBytes(byte[] bytes) {
7979
public static UuidBuilder fromGregorian(Timestamp ts, NodeId nodeId) {
8080
long ticks = ts.asGregorian();
8181
int timeLow = (int) (ticks & 0xFFFF_FFFFL);
82-
short timeMid = (short) ((ticks >> 32) & 0xFFFFL);
83-
short timeHighAndVersion = (short) (((ticks >> 48) & 0x0FFFL) | (1 << 12));
82+
short timeMid = (short) ((ticks >>> 32) & 0xFFFFL);
83+
short timeHighAndVersion = (short) (((ticks >>> 48) & 0x0FFFL) | (1 << 12));
8484

8585
UuidBuilder builder = empty();
8686
builder.bytes
8787
.putInt(timeLow)
8888
.putShort(timeMid)
8989
.putShort(timeHighAndVersion)
90-
.put((byte) (((ts.counter & 0x3F00) >> 8) | 0x80))
90+
.put((byte) (((ts.counter & 0x3F00) >>> 8) | 0x80))
9191
.put((byte) (ts.counter & 0xFF))
9292
.put(nodeId.unwrap());
9393
return builder;
@@ -119,23 +119,23 @@ public static UuidBuilder fromSha1Bytes(byte[] bytes) {
119119

120120
public static UuidBuilder fromSortedGregorian(Timestamp ts, NodeId nodeId) {
121121
long ticks = ts.asGregorian();
122-
int timeLow = (int) ((ticks >> 28) & 0xFFFF_FFFFL);
123-
short timeMid = (short) ((ticks >> 12) & 0xFFFFL);
122+
int timeLow = (int) ((ticks >>> 28) & 0xFFFF_FFFFL);
123+
short timeMid = (short) ((ticks >>> 12) & 0xFFFFL);
124124
short timeHighAndVersion = (short) ((ticks & 0x0FFFL) | (0b110 << 12));
125125

126126
UuidBuilder builder = empty();
127127
builder.bytes
128128
.putInt(timeLow)
129129
.putShort(timeMid)
130130
.putShort(timeHighAndVersion)
131-
.put((byte) (((ts.counter & 0x3F00) >> 8) | 0x80))
131+
.put((byte) (((ts.counter & 0x3F00) >>> 8) | 0x80))
132132
.put((byte) (ts.counter & 0xFF))
133133
.put(nodeId.unwrap());
134134
return builder;
135135
}
136136

137137
public static UuidBuilder fromUnixTimestampMillis(long millis, long randH, int randL) {
138-
int millisHigh = (int) ((millis >> 16) & 0xFFFF_FFFFL);
138+
int millisHigh = (int) ((millis >>> 16) & 0xFFFF_FFFFL);
139139
short millisLow = (short) (millis & 0xFFFF);
140140
long randHighWithVersionAndVariant = randH & 0x0FFF3FFFFFFFFFFFL | 0x7000800000000000L;
141141
UuidBuilder builder = empty();
@@ -149,7 +149,7 @@ public static UuidBuilder fromUnixTimestampMillis(long millis, long randH, int r
149149
}
150150

151151
public static UuidBuilder fromUnixTimestampMillis(long millis, byte[] bytes) {
152-
int millisHigh = (int) ((millis >> 16) & 0xFFFF_FFFFL);
152+
int millisHigh = (int) ((millis >>> 16) & 0xFFFF_FFFFL);
153153
short millisLow = (short) (millis & 0xFFFF);
154154

155155
short withVersion = (short) ((bytes[1] & 0xFF) | (((bytes[0] & 0xFF) << 8) & 0x0FFF) | 0x7000);

0 commit comments

Comments
 (0)