Use logical 'and' instead of bitwise 'and'

Closes gh-8198
This commit is contained in:
Johnny Lim
2017-02-06 11:01:18 +09:00
committed by Stephane Nicoll
parent b4858882f3
commit 0adab8a2be
11 changed files with 37 additions and 37 deletions

View File

@@ -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;
}

View File

@@ -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);