Lines 129-138
Link Here
|
129 |
Target t = getTarget(ctx); |
129 |
Target t = getTarget(ctx); |
130 |
ctx.setPropertyResolved(false); |
130 |
ctx.setPropertyResolved(false); |
131 |
ELResolver resolver = ctx.getELResolver(); |
131 |
ELResolver resolver = ctx.getELResolver(); |
132 |
resolver.setValue(ctx, t.base, t.property, |
132 |
|
133 |
// coerce to the expected type |
133 |
Class<?> targetClass = resolver.getType(ctx, t.base, t.property); |
134 |
ELSupport.coerceToType(value, |
134 |
|
135 |
resolver.getType(ctx, t.base, t.property))); |
135 |
// value is not assignable so coerce to the expected type |
|
|
136 |
if ((value == null && targetClass.isPrimitive()) || (value != null && !targetClass.isInstance(value))) { |
137 |
value = ELSupport.coerceToType(value, resolver.getType(ctx, t.base, t.property)); |
138 |
} |
139 |
|
140 |
resolver.setValue(ctx, t.base, t.property, value); |
136 |
} |
141 |
} |
137 |
|
142 |
|
138 |
public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) |
143 |
public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) |