8219378: Ensure ReflectionFactory.langReflectAccess is initialized correctly
Reviewed-by: rriggs, alanb, mchung
Contributed-by: andrew_m_leonard@uk.ibm.com
--- 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;
}