Set hex value to null if value is null
Retain internal consistency in the code.
Since value is set to null if it is an empty string,
it makes sense to set valueHex to null if value
is null.
@@ -43,7 +43,7 @@ public class URICheckEncodingMonitor extends AdministrativeMonitor {
if (!expected.equals(value)) {
String expectedHex = Util.toHexString(expected.getBytes(StandardCharsets.UTF_8));
- String valueHex = value != null ? Util.toHexString(value.getBytes(StandardCharsets.UTF_8)) : "<empty string>";
+ String valueHex = value != null ? Util.toHexString(value.getBytes(StandardCharsets.UTF_8)) : null;
LOGGER.log(Level.CONFIG, "Expected to receive: " + expected + " (" + expectedHex + ") but got: " + value + " (" + valueHex + ")");
return FormValidation.warningWithMarkup(hudson.model.Messages.Hudson_NotUsesUTF8ToDecodeURL());
}
