in src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/GenHelper.java [43:55]
public static void typeCoercion(JavaSource source, SideEffectVisitor visitor, TypedNode node, Type type) {
if (type == node.getType() || type == Type.UNKNOWN) {
node.getNode().accept(visitor);
} else if (type == Type.LONG && node.getType() == Type.DOUBLE) {
callLongCoercion(source, visitor, node.getNode());
} else {
String coercionMethod = dynamicCoercions.get(type);
if (coercionMethod == null) {
throw new UnsupportedOperationException("Cannot generate coercion to type " + type);
}
callDynamicCoercion(source, visitor, node.getNode(), dynamicCoercions.get(type));
}
}