src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java
Print this page
*** 39,48 ****
--- 39,49 ----
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+ import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import jdk.internal.dynalink.CallSiteDescriptor;
*** 461,472 ****
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(Context.NASHORN_CREATE_GLOBAL));
}
! // null check on context
! context.getClass();
return $nasgenmap$;
}
/**
--- 462,472 ----
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(Context.NASHORN_CREATE_GLOBAL));
}
! Objects.requireNonNull(context);
return $nasgenmap$;
}
/**
*** 486,496 ****
*
* @return the global singleton
*/
public static Global instance() {
final Global global = Context.getGlobal();
! global.getClass(); // null check
return global;
}
private static Global instanceFrom(final Object self) {
return self instanceof Global? (Global)self : instance();
--- 486,496 ----
*
* @return the global singleton
*/
public static Global instance() {
final Global global = Context.getGlobal();
! Objects.requireNonNull(global);
return global;
}
private static Global instanceFrom(final Object self) {
return self instanceof Global? (Global)self : instance();