This repository contains custom error-prone checks for Hyperledger Besu.
These custom error-prone checks are used in the Besu codebase. To use these checks in your project:
- Add the following repository definition to your gradle file:
repositories {
maven {
url 'https://hyperledger.jfrog.io/hyperledger/besu-maven'
content { includeGroupByRegex('org\\.hyperledger\\..*') }
}
}- Add the following dependency to your gradle file:
dependencies {
errorprone("org.hyperledger.errorpronechecks:besu-errorprone-checks:1.2.0")
}The following custom error-prone checks are included in this repository:
- Banned Methods
- Avoid creating SecureRandom instances directly
- Avoid creating MessageDigest instances directly
- Do not return null Optionals
- Experimental CLI options annotation must be set
hiddentotrue - Method input parameters must be final
- Prefer java not-null annotations over JetBrains not-null annotations
- Loggers modifiers must be private, static, and final
The creation of custom errorprone checkers was largely derived from:
- https://github.com/tbroyer/gradle-errorprone-plugin
- https://errorprone.info/docs/installation
- https://github.com/google/error-prone/wiki/Writing-a-check
To allow for debugging from within intellij, the following must be added to the VM args
in the run/debug configuration (this assumes your gradle cache is at the default location under
your home):
-Xbootclasspath/p:${HOME}/.gradle/caches/./modules-2/files-2.1/com.google.errorprone/javac/9+181-r4173-1/bdf4c0aa7d540ee1f7bf14d47447aea4bbf450c5/javac-9+181-r4173-1.jar