style: include ENMI_EQUALS_ON_ENUM
(#5189)
This commit is contained in:
parent
1a98ebe36b
commit
2cda944643
@ -222,9 +222,6 @@
|
||||
<Match>
|
||||
<Bug pattern="FCBL_FIELD_COULD_BE_LOCAL" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="ENMI_EQUALS_ON_ENUM" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="IMC_IMMATURE_CLASS_VAR_NAME" />
|
||||
</Match>
|
||||
|
@ -124,14 +124,14 @@ class LWWElementSet {
|
||||
* @return True if the first element's timestamp is greater or the bias is ADDS and timestamps are equal.
|
||||
*/
|
||||
public boolean compareTimestamps(Element e, Element other) {
|
||||
if (!e.bias.equals(other.bias)) {
|
||||
if (e.bias != other.bias) {
|
||||
throw new IllegalArgumentException("Invalid bias value");
|
||||
}
|
||||
Bias bias = e.bias;
|
||||
int timestampComparison = Integer.compare(e.timestamp, other.timestamp);
|
||||
|
||||
if (timestampComparison == 0) {
|
||||
return !bias.equals(Bias.ADDS);
|
||||
return bias != Bias.ADDS;
|
||||
}
|
||||
return timestampComparison < 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user