Revert "Revert "Update Codegen.java""

This reverts commit 47a162e8a260ed37d7b2e6743f26fb8a66a34000.