[CALCITE-545] When a projected expression can only have one value, replace with that constant

Fix conversion of Character to char in generated Java code.