Fix java generation for nan values, use Float.NaN and Double.NaN