Fix: Fallback to getName when canonicalName is null in BlockHeaderValidator DEBUG log (#6332)

* fallback to simple name when canonical name is null
* use getName instead of getSimpleName to include the package name

Signed-off-by: Manoj P R <manojpramesh@gmail.com>

---------

Signed-off-by: Manoj P R <manojpramesh@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/6360/head
Manoj P R 11 months ago committed by GitHub
parent ae53021156
commit 7f77d307a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockHeaderValidator.java

@ -84,7 +84,10 @@ public class BlockHeaderValidator {
rule -> {
boolean worked = rule.validate(header, parent, protocolContext);
if (!worked) {
LOG.debug("{} rule failed", rule.innerRuleClass().getCanonicalName());
String canonicalName = rule.innerRuleClass().getCanonicalName();
LOG.debug(
"{} rule failed",
canonicalName == null ? rule.innerRuleClass().getName() : canonicalName);
}
return worked;
});

Loading…
Cancel
Save