【fix sonar】UUIDGenerator文件
This commit is contained in:
+5
-2
@@ -10,6 +10,10 @@ import java.net.InetAddress;
|
||||
*/
|
||||
public class UUIDGenerator {
|
||||
|
||||
private UUIDGenerator(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 产生一个32位的UUID
|
||||
@@ -87,9 +91,8 @@ public class UUIDGenerator {
|
||||
private final static int toInt(byte[] bytes) {
|
||||
int result = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
result = (result << 8) - Byte.MIN_VALUE + (int) bytes[i];
|
||||
result = (result << 8) - (Byte.MIN_VALUE & 0xff) + bytes[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user