Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
PROC-1444: Check expected type for Objects
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharygoodwin committed Feb 29, 2024
1 parent 00f02ee commit c222086
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,10 @@ static void checkRuleIsBooleanType(
// To support users writing rules, be more strict here in requiring the type of the
// value to be expected before coercion
Class<?> type = ve.getType(elContext);
// if rule is not primitive type attempt to get value with context values
if (!ClassUtils.isPrimitiveWrapper(type)) {
type = ve.getValue(elContext).getClass();
}

if (ClassUtils.isPrimitiveWrapper(type)) {
type = ClassUtils.wrapperToPrimitive(type);
} else if (type == Object.class) {
type = ve.getExpectedType();
}
// allow null to be coerced for historic reasons
if ((type != null) && (type != boolean.class)) {
Expand Down

0 comments on commit c222086

Please sign in to comment.