Dopiero się uczę pisać specyfikacje i mam problem z Boolean & Sonarem. Chodzi o ten fragment kodu:
private Specification<RolePrivilege> atLeastOneIsTrue()
{
return specificationsUtil.fieldEqual(RolePrivilege_.read, Boolean.TRUE).or
(specificationsUtil.fieldEqual(RolePrivilege_.delete, Boolean.TRUE)).or
(specificationsUtil.fieldEqual(RolePrivilege_.update, Boolean.TRUE)).or
(specificationsUtil.fieldEqual(RolePrivilege_.creation, Boolean.TRUE));
}
Sonar przyczepił się, że Boolean może być Nullem. Zastanawiam się jak to zmienić i jakoś polegam...
Jak należałoby to poprawnie napisać?
Dzięki!