1.1 --- a/src/jdk/nashorn/internal/codegen/CompileUnit.java Wed Aug 07 16:38:44 2013 +0200 1.2 +++ b/src/jdk/nashorn/internal/codegen/CompileUnit.java Thu Aug 08 16:38:32 2013 +0530 1.3 @@ -33,7 +33,7 @@ 1.4 private final String className; 1.5 1.6 /** Current class generator */ 1.7 - private final ClassEmitter classEmitter; 1.8 + private ClassEmitter classEmitter; 1.9 1.10 private long weight; 1.11 1.12 @@ -64,7 +64,11 @@ 1.13 * @param clazz class with code for this compile unit 1.14 */ 1.15 void setCode(final Class<?> clazz) { 1.16 + clazz.getClass(); // null check 1.17 this.clazz = clazz; 1.18 + // Revisit this - refactor to avoid null-ed out non-final fields 1.19 + // null out emitter 1.20 + this.classEmitter = null; 1.21 } 1.22 1.23 /**