Fix Java Generator to always generate valid Java variable names

Current BasicJavaGenerator can generate Java that won't compile as the variable names are invalid. This patch guarantees valid Java variable names.