Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -730,19 +730,21 @@ public T deserialize(Map<String, Object> values, Map<TypeVariable<Class<T>>, Typ
throw new RuntimeException(e);
}
} else {
String message =
"No setter/field for "
+ propertyName
+ " found "
+ "on class "
+ this.clazz.getName();
if (this.properties.containsKey(propertyName.toLowerCase())) {
message += " (fields/setters are case sensitive!)";
}
if (this.throwOnUnknownProperties) {
throw new DatabaseException(message);
} else if (this.warnOnUnknownProperties) {
logger.warn(message);
if (this.throwOnUnknownProperties || this.warnOnUnknownProperties) {
String message =
"No setter/field for "
+ propertyName
+ " found "
+ "on class "
+ this.clazz.getName();
if (this.properties.containsKey(propertyName.toLowerCase())) {
message += " (fields/setters are case sensitive!)";
}
if (this.throwOnUnknownProperties) {
throw new DatabaseException(message);
} else if (this.warnOnUnknownProperties) {
logger.warn(message);
}
Comment on lines +745 to +747

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since this block is already guarded by if (this.throwOnUnknownProperties || this.warnOnUnknownProperties), the check for this.warnOnUnknownProperties in the else if is redundant. If this.throwOnUnknownProperties is false, this.warnOnUnknownProperties must be true for the outer condition to have been met. You can simplify this to a simple else block for better readability.

Suggested change
} else if (this.warnOnUnknownProperties) {
logger.warn(message);
}
} else {
logger.warn(message);
}

}
}
}
Expand Down
Loading