-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Description
I would like to request support for Java 17 compatibility for this library. Currently, the library uses DatatypeConverter.parseHexBinary, which is not available in Java 17. This method is often used for converting hexadecimal strings to byte arrays, which is a common requirement.
Steps to Reproduce
- Attempt to use DatatypeConverter.parseHexBinary in a Java 17 project.
- Observe that the method is not available and results in a compilation error.
Suggested Solution
To ensure compatibility with Java 17 and above, and to avoid unnecessary coupling with the jakarta.xml.bind library, I suggest removing this dependency from the project. Instead, consider using the HexFormat class available in Java 17 or providing a custom utility method for earlier versions.
| byte[] keyBytes = DatatypeConverter.parseHexBinary(this.key); |
Here is a proposed to change method that can be used for versions prior to Java 17:
byte[] keyBytes = HexFormat.of().parseHex(this.key);
Remove not necessary dependency at pom.xml file.
Lines 36 to 40 in 07be81e
| <dependency> | |
| <groupId>jakarta.xml.bind</groupId> | |
| <artifactId>jakarta.xml.bind-api</artifactId> | |
| <version>3.0.1</version> | |
| </dependency> |