Skip to content

Commit da508a2

Browse files
committed
Simplified condition
1 parent fb3b066 commit da508a2

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/main/java/com/jsoniter/extra/GsonCompatibilityMode.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,18 @@ public boolean equals(Object o) {
176176

177177
Builder builder = (Builder) o;
178178

179-
if (excludeFieldsWithoutExposeAnnotation != builder.excludeFieldsWithoutExposeAnnotation) return false;
180-
if (disableHtmlEscaping != builder.disableHtmlEscaping) return false;
181-
if (!dateFormat.get().equals(builder.dateFormat.get())) return false;
182-
if (fieldNamingStrategy != null ? !fieldNamingStrategy.equals(builder.fieldNamingStrategy) : builder.fieldNamingStrategy != null)
183-
return false;
184-
if (version != null ? !version.equals(builder.version) : builder.version != null) return false;
185-
if (serializationExclusionStrategies != null ? !serializationExclusionStrategies.equals(builder.serializationExclusionStrategies) : builder.serializationExclusionStrategies != null)
186-
return false;
187-
return deserializationExclusionStrategies != null ? deserializationExclusionStrategies.equals(builder.deserializationExclusionStrategies) : builder.deserializationExclusionStrategies == null;
179+
return excludeFieldsWithoutExposeAnnotation == builder.excludeFieldsWithoutExposeAnnotation &&
180+
disableHtmlEscaping == builder.disableHtmlEscaping &&
181+
dateFormat.get().equals(builder.dateFormat.get()) &&
182+
(fieldNamingStrategy != null ? fieldNamingStrategy.equals(builder.fieldNamingStrategy) :
183+
builder.fieldNamingStrategy == null) &&
184+
(version != null ? version.equals(builder.version) : builder.version == null) &&
185+
(serializationExclusionStrategies != null ?
186+
serializationExclusionStrategies.equals(builder.serializationExclusionStrategies) :
187+
builder.serializationExclusionStrategies == null) &&
188+
(deserializationExclusionStrategies != null ?
189+
deserializationExclusionStrategies.equals(builder.deserializationExclusionStrategies) :
190+
builder.deserializationExclusionStrategies == null);
188191
}
189192

190193
@Override

0 commit comments

Comments
 (0)