Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
k163377 committed Aug 26, 2023
1 parent d48f9f6 commit 78b17fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -802,15 +802,9 @@ protected void removeIgnorableTypes(SerializationConfig config, BeanDescription
protected void removeSetterlessGetters(SerializationConfig config, BeanDescription beanDesc,
List<BeanPropertyDefinition> properties)
{
Iterator<BeanPropertyDefinition> it = properties.iterator();
while (it.hasNext()) {
BeanPropertyDefinition property = it.next();
// one caveat: only remove implicit properties;
// explicitly annotated ones should remain
if (!property.couldDeserialize() && !property.isExplicitlyIncluded()) {
it.remove();
}
}
// one caveat: only remove implicit properties;
// explicitly annotated ones should remain
properties.removeIf(property -> !property.couldDeserialize() && !property.isExplicitlyIncluded());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ public boolean hasSingleElement(Iterable<?> value) {
Iterator<?> it = value.iterator();
if (it.hasNext()) {
it.next();
if (!it.hasNext()) {
return true;
}
return !it.hasNext();
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ protected UUIDSerializer(Boolean asBinary) {
public boolean isEmpty(SerializerProvider prov, UUID value)
{
// Null UUID is empty, so...
if (value.getLeastSignificantBits() == 0L
&& value.getMostSignificantBits() == 0L) {
return true;
}
return false;
return value.getLeastSignificantBits() == 0L
&& value.getMostSignificantBits() == 0L;
}

@Override
Expand Down

0 comments on commit 78b17fb

Please sign in to comment.