src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompileUnit.java

Print this page

        

*** 24,33 **** --- 24,34 ---- */ package jdk.nashorn.internal.codegen; import java.io.Serializable; + import java.util.Objects; import java.util.Set; import java.util.TreeSet; import jdk.nashorn.internal.ir.CompileUnitHolder; /**
*** 111,121 **** /** * Set class when it exists. Only accessible from compiler * @param clazz class with code for this compile unit */ void setCode(final Class<?> clazz) { ! clazz.getClass(); // null check this.clazz = clazz; // Revisit this - refactor to avoid null-ed out non-final fields // null out emitter this.classEmitter = null; } --- 112,122 ---- /** * Set class when it exists. Only accessible from compiler * @param clazz class with code for this compile unit */ void setCode(final Class<?> clazz) { ! Objects.requireNonNull(clazz); this.clazz = clazz; // Revisit this - refactor to avoid null-ed out non-final fields // null out emitter this.classEmitter = null; }