Init to null (instead of nothing) all non-primitive attributes in the generated builder class in order to help spotbugs-maven-plugin to check null safety on @javax.annotation.Nonnull fields or parameters #173
Init to null (instead of nothing) all non-primitive attributes in the generated builder class in order to help spotbugs-maven-plugin to check null safety on @javax.annotation.Nonnull fields or parameters
Globally, the spotbugs-maven-plugin checks at compile time null safety based on @NonNull / @Nullable annotations and null assignation.
For more explanation, you can read this article https://reflectoring.io/spring-boot-null-safety-annotations/ .
Today, the null check on the generated builder is not detected because the attribute of the builder is not set to null, so the maven plugin can not check easily if the call of the constructor of the class in the build method passes some null parameters.
If you are ok with the idea, I can check to make a pull request to add this enhancement.
Init to null (instead of nothing) all non-primitive attributes in the generated builder class in order to help spotbugs-maven-plugin to check null safety on @javax.annotation.Nonnull fields or parameters
Globally, the spotbugs-maven-plugin checks at compile time null safety based on @NonNull / @Nullable annotations and null assignation. For more explanation, you can read this article https://reflectoring.io/spring-boot-null-safety-annotations/ .
Today, the null check on the generated builder is not detected because the attribute of the builder is not set to null, so the maven plugin can not check easily if the call of the constructor of the class in the build method passes some null parameters.
If you are ok with the idea, I can check to make a pull request to add this enhancement.