8219378: Ensure ReflectionFactory.langReflectAccess is initialized correctly
authoraleonard
Tue, 19 Feb 2019 16:13:05 +0000
changeset 53926 7272e7c5164b
parent 53925 c216c40ba47b
child 53927 03924ad3f4d0
8219378: Ensure ReflectionFactory.langReflectAccess is initialized correctly Reviewed-by: rriggs, alanb, mchung Contributed-by: andrew_m_leonard@uk.ibm.com
src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java
--- a/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java	Tue Feb 26 10:39:28 2019 -0500
+++ b/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java	Tue Feb 19 16:13:05 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2019, 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
@@ -175,7 +175,7 @@
     public FieldAccessor newFieldAccessor(Field field, boolean override) {
         checkInitted();
 
-        Field root = langReflectAccess.getRoot(field);
+        Field root = langReflectAccess().getRoot(field);
         if (root != null) {
             // FieldAccessor will use the root unless the modifiers have
             // been overrridden
@@ -197,7 +197,7 @@
         }
 
         // use the root Method that will not cache caller class
-        Method root = langReflectAccess.getRoot(method);
+        Method root = langReflectAccess().getRoot(method);
         if (root != null) {
             method = root;
         }
@@ -233,7 +233,7 @@
         }
 
         // use the root Constructor that will not cache caller class
-        Constructor<?> root = langReflectAccess.getRoot(c);
+        Constructor<?> root = langReflectAccess().getRoot(c);
         if (root != null) {
             c = root;
         }