-
Notifications
You must be signed in to change notification settings - Fork 5
Release 2.2.0 #64
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
Release 2.2.0 #64
Conversation
Move the empty list check before sorting to avoid processing an empty collection and provide clearer error handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This release upgrades the GUID and utility modules by adding UUIDv7 support and cleaning up utility behaviors and tests.
- Introduces
SequentialUuidCreatorfor UUID version 7 generation. - Removes unused SLF4J loggers and tightens exception handling in utility classes (
RangeUtil,CollectionUtil,AesUtil, etc.). - Adds comprehensive JUnit tests for core utilities and updates method contracts (throws, messages).
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| guid/src/main/java/com/onixbyte/guid/impl/SnowflakeGuidCreator.java | Removed unused SLF4J logger |
| guid/src/main/java/com/onixbyte/guid/impl/SequentialUuidCreator.java | New class implementing UUIDv7 spec |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/RangeUtil.java | Fixed range logic, updated exception messages and Javadoc |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/CollectionUtil.java | Tightened maxSize check, removed logger |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/AesUtil.java | Swallowed errors → throws GeneralSecurityException, improved API |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/MapUtil.java | Removed unused SLF4J logger |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/HashUtil.java | Removed unused SLF4J logger |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/Base64Util.java | Removed unused SLF4J logger |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/BoolUtil.java | Removed unused SLF4J logger |
| devkit-utils/src/main/java/com/onixbyte/devkit/utils/BranchUtil.java | Removed deprecated method and logger |
| devkit-utils/src/test/java/com/onixbyte/devkit/utils/* | Removed outdated tests, added new coverage for all utility methods |
Comments suppressed due to low confidence (2)
guid/src/main/java/com/onixbyte/guid/impl/SequentialUuidCreator.java:39
- The new SequentialUuidCreator lacks unit tests; consider adding tests to verify UUIDv7 timestamp encoding, version bits, and variant bits compliance.
public class SequentialUuidCreator implements GuidCreator<UUID> {
guid/src/main/java/com/onixbyte/guid/impl/SequentialUuidCreator.java:57
- [nitpick] Variable 'value' is ambiguous—rename to 'bytes' or 'uuidBytes' for better clarity.
var value = randomBytes();
| cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, new IvParameterSpec(secret)); | ||
| return cipher.doFinal(data); |
Copilot
AI
Jun 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the static secret key as IV can lead to IV reuse vulnerabilities in CBC mode; consider generating a random IV per encryption and prefixing it to the ciphertext.
| cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, new IvParameterSpec(secret)); | |
| return cipher.doFinal(data); | |
| var iv = new byte[16]; // AES block size is 16 bytes | |
| var secureRandom = new java.security.SecureRandom(); | |
| secureRandom.nextBytes(iv); | |
| cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, new IvParameterSpec(iv)); | |
| var encryptedData = cipher.doFinal(data); | |
| var result = new byte[iv.length + encryptedData.length]; | |
| System.arraycopy(iv, 0, result, 0, iv.length); | |
| System.arraycopy(encryptedData, 0, result, iv.length, encryptedData.length); | |
| return result; |
Whats new