Use logical 'and' instead of bitwise 'and'
Closes gh-8198
This commit is contained in:
committed by
Stephane Nicoll
parent
b4858882f3
commit
0adab8a2be
@@ -95,9 +95,9 @@ public class InMemoryAuditEventRepository implements AuditEventRepository {
|
||||
|
||||
private boolean isMatch(String principal, Date after, String type, AuditEvent event) {
|
||||
boolean match = true;
|
||||
match &= (principal == null || event.getPrincipal().equals(principal));
|
||||
match &= (after == null || event.getTimestamp().compareTo(after) >= 0);
|
||||
match &= (type == null || event.getType().equals(type));
|
||||
match = match && (principal == null || event.getPrincipal().equals(principal));
|
||||
match = match && (after == null || event.getTimestamp().compareTo(after) >= 0);
|
||||
match = match && (type == null || event.getType().equals(type));
|
||||
return match;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,9 +126,9 @@ public class Metric<T extends Number> {
|
||||
if (obj instanceof Metric) {
|
||||
Metric<?> other = (Metric<?>) obj;
|
||||
boolean rtn = true;
|
||||
rtn &= ObjectUtils.nullSafeEquals(this.name, other.name);
|
||||
rtn &= ObjectUtils.nullSafeEquals(this.timestamp, other.timestamp);
|
||||
rtn &= ObjectUtils.nullSafeEquals(this.value, other.value);
|
||||
rtn = rtn && ObjectUtils.nullSafeEquals(this.name, other.name);
|
||||
rtn = rtn && ObjectUtils.nullSafeEquals(this.timestamp, other.timestamp);
|
||||
rtn = rtn && ObjectUtils.nullSafeEquals(this.value, other.value);
|
||||
return rtn;
|
||||
}
|
||||
return super.equals(obj);
|
||||
|
||||
Reference in New Issue
Block a user