< prev index next >
src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 42,51 ****
--- 42,52 ----
import java.security.Permission;
import java.security.PrivilegedAction;
import java.util.Objects;
import java.util.Properties;
+ import jdk.internal.misc.VM;
import sun.reflect.misc.ReflectUtil;
import sun.security.action.GetPropertyAction;
/** <P> The master factory for all reflective objects, both those in
java.lang.reflect (Fields, Methods, Constructors) as well as their
*** 583,603 ****
java.lang.reflect.AccessibleObject) causes this class's to be
run, before the system properties are set up. */
private static void checkInitted() {
if (initted) return;
! // Tests to ensure the system properties table is fully
! // initialized. This is needed because reflection code is
! // called very early in the initialization process (before
! // command-line arguments have been parsed and therefore
! // these user-settable properties installed.) We assume that
! // if System.out is non-null then the System class has been
! // fully initialized and that the bulk of the startup code
! // has been run.
!
! if (System.out == null) {
! // java.lang.System not yet fully initialized
return;
}
Properties props = GetPropertyAction.privilegedGetProperties();
String val = props.getProperty("sun.reflect.noInflation");
--- 584,597 ----
java.lang.reflect.AccessibleObject) causes this class's to be
run, before the system properties are set up. */
private static void checkInitted() {
if (initted) return;
! // Defer initialization until module system is initialized so as
! // to avoid inflation and spinning bytecode in unnamed modules
! // during early startup.
! if (!VM.isModuleSystemInited()) {
return;
}
Properties props = GetPropertyAction.privilegedGetProperties();
String val = props.getProperty("sun.reflect.noInflation");
< prev index next >