-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More instanceof pattern matching #4191
Conversation
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
@@ -589,7 +589,7 @@ private boolean checkType(Type type, Object configValue) { | |||
return configValue instanceof Boolean; | |||
case INTEGER: | |||
return configValue instanceof BigDecimal || configValue instanceof Integer | |||
|| configValue instanceof Double && ((Double) configValue).intValue() == (Double) configValue; | |||
|| configValue instanceof Double doubleValue && doubleValue.intValue() == (Double) configValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|| configValue instanceof Double doubleValue && doubleValue.intValue() == (Double) configValue; | |
|| configValue instanceof Double doubleValue && doubleValue.intValue() == doubleValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Some clean-up.