Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: EJBCA 6.9.0
-
Fix Version/s: EJBCA 7.0.0, EJBCA 6.15.2
-
Component/s: None
-
Labels:
-
Sprint:EJBCA Team Bob - 2019 w2
Description
Findbugs reports:
org.ejbca.core.model.validation.BlacklistEntry.java:114 CORRECTNESS RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE Normal Nullcheck of newEntry at line 115 of value previously dereferenced in org.ejbca.core.model.validation.BlacklistEntry.diff(BlacklistEntry) A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous.
newEntry != null should probably be newEntry.getValue() != null in the following:
public Map<Object, Object> diff(BlacklistEntry newEntry) { Map<Object, Object> result = new LinkedHashMap<Object, Object>(); if (!StringUtils.equals(this.getValue(), newEntry.getValue())) { result.put("changed:value", newEntry != null ? newEntry.getValue() : "null"); } if (!StringUtils.equals(this.getData(), newEntry.getData())) { result.put("changed:data", newEntry != null ? newEntry.getData() : "null"); } return result; }
Attachments
Issue Links
- is caused by
-
ECA-6054 Generalize PublicKeyBlacklistData into BlacklistData
-
- Closed
-