Closed meseer closed 8 years ago
These fields are made to be used by the "build" method in order to check if the property value was explicitly set. See AddressBuilder for an example. In you sample the check is not necessary since the property is passed to the pojo's constructor anyway.
Additionally the isSet-property is declared as protected field so that it can be used by any subclass of the builder. PB can't know if you are planning to use it or not. So I can't remove it just for the sake that FindBugs is fine with it. Anyway I would suggest that you configure FindBugs to not check generated code.
Given the following Pojo:
PojoBuilder will generate PojoBuilder with isSet$.. properties, which are not used neither in the build() method, not anywhere else. FindBugs will report this as a
UrF: Unread field
Expected: no unused field generated and FindBugs happy with a autogenerated code.