bito-code-review[bot] commented on PR #15828:
URL: https://github.com/apache/grails-core/pull/15828#issuecomment-4884578154
<!-- Bito Reply -->
The current implementation of `decodeHex` uses a restrictive guard
(`theTarget == null || theTarget instanceof NullObject ||
theTarget.toString().length() == 0`) which deviates from the previous
Groovy-truthiness check (`if (!theTarget) return null`). This change can cause
exceptions or unexpected behavior for inputs that were previously considered
falsy in Groovy, such as `0` or empty collections. To restore the original
contract and ensure compatibility with Groovy-truthiness, the guard should be
updated to use the `!theTarget` check.
**grails-codecs-core/src/main/groovy/org/grails/plugins/codecs/HexCodecExtensionMethods.groovy**
```
static Object decodeHex(Object theTarget) {
if (!theTarget) return null
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]