Copilot commented on code in PR #981:
URL: https://github.com/apache/ranger/pull/981#discussion_r3303849747
##########
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerJersey2ClientBuilder.java:
##########
@@ -355,8 +357,7 @@ public static boolean
validateAntiMoxyConfiguration(ClientConfig config) {
boolean jacksonRegistered =
config.getClasses().contains(JacksonJaxbJsonProvider.class) ||
config.getInstances().stream().anyMatch(instance -> instance instanceof
JacksonJaxbJsonProvider);
if (!jacksonRegistered) {
- LOG.error("CRITICAL: Jackson JSON provider is not registered!
Default JSON processing may fail.");
- isValid = false;
+ LOG.error("CRITICAL: Jackson JSON provider is not registered!
Default JSON processing may fail. Classes={}",
config.getClasses().stream().map(Class::getCanonicalName).collect(Collectors.toList()));
Review Comment:
`validateAntiMoxyConfiguration()` logs a CRITICAL error when
`JacksonJaxbJsonProvider` is not registered, but it no longer sets
`isValid=false` in that branch. As a result, the method can return `true` (and
skip throwing) even though the configuration is flagged as invalid. Please
either mark the configuration invalid when Jackson isn’t registered (restoring
`isValid=false`) or adjust the method’s contract/log level so it’s consistent.
--
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]