Skip to content

Commit 2dac530

Browse files
committed
style: include ENMI_EQUALS_ON_ENUM
1 parent 1a98ebe commit 2dac530

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

spotbugs-exclude.xml

-3
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@
222222
<Match>
223223
<Bug pattern="FCBL_FIELD_COULD_BE_LOCAL" />
224224
</Match>
225-
<Match>
226-
<Bug pattern="ENMI_EQUALS_ON_ENUM" />
227-
</Match>
228225
<Match>
229226
<Bug pattern="IMC_IMMATURE_CLASS_VAR_NAME" />
230227
</Match>

src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ public void merge(LWWElementSet other) {
124124
* @return True if the first element's timestamp is greater or the bias is ADDS and timestamps are equal.
125125
*/
126126
public boolean compareTimestamps(Element e, Element other) {
127-
if (!e.bias.equals(other.bias)) {
127+
if (e.bias != other.bias) {
128128
throw new IllegalArgumentException("Invalid bias value");
129129
}
130130
Bias bias = e.bias;
131131
int timestampComparison = Integer.compare(e.timestamp, other.timestamp);
132132

133133
if (timestampComparison == 0) {
134-
return !bias.equals(Bias.ADDS);
134+
return bias != Bias.ADDS;
135135
}
136136
return timestampComparison < 0;
137137
}

0 commit comments

Comments
 (0)