< prev index next >
src/share/vm/runtime/reflection.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 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.
--- 1,7 ----
/*
! * Copyright (c) 1997, 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.
*** 475,485 ****
------------------------------------------------------------------------------------------------
Note: a loose module is a module that can read all current and future unnamed modules.
*/
Reflection::VerifyClassAccessResults Reflection::verify_class_access(
! const Klass* current_class, const Klass* new_class, bool classloader_only) {
// Verify that current_class can access new_class. If the classloader_only
// flag is set, we automatically allow any accesses in which current_class
// doesn't have a classloader.
if ((current_class == NULL) ||
--- 475,485 ----
------------------------------------------------------------------------------------------------
Note: a loose module is a module that can read all current and future unnamed modules.
*/
Reflection::VerifyClassAccessResults Reflection::verify_class_access(
! const Klass* current_class, const InstanceKlass* new_class, bool classloader_only) {
// Verify that current_class can access new_class. If the classloader_only
// flag is set, we automatically allow any accesses in which current_class
// doesn't have a classloader.
if ((current_class == NULL) ||
*** 502,518 ****
}
// Find the module entry for current_class, the accessor
ModuleEntry* module_from = current_class->module();
// Find the module entry for new_class, the accessee
- if (new_class->is_objArray_klass()) {
- new_class = ObjArrayKlass::cast(new_class)->bottom_klass();
- }
- if (new_class->is_typeArray_klass()) {
- // A TypeArray's defining module is java.base, access to the TypeArray is allowed
- return ACCESS_OK;
- }
ModuleEntry* module_to = new_class->module();
// both in same (possibly unnamed) module
if (module_from == module_to) {
return ACCESS_OK;
--- 502,511 ----
*** 561,571 ****
}
// Return an error message specific to the specified Klass*'s and result.
// This function must be called from within a block containing a ResourceMark.
char* Reflection::verify_class_access_msg(const Klass* current_class,
! const Klass* new_class,
VerifyClassAccessResults result) {
assert(result != ACCESS_OK, "must be failure result");
char * msg = NULL;
if (result != OTHER_PROBLEM && new_class != NULL && current_class != NULL) {
// Find the module entry for current_class, the accessor
--- 554,564 ----
}
// Return an error message specific to the specified Klass*'s and result.
// This function must be called from within a block containing a ResourceMark.
char* Reflection::verify_class_access_msg(const Klass* current_class,
! const InstanceKlass* new_class,
VerifyClassAccessResults result) {
assert(result != ACCESS_OK, "must be failure result");
char * msg = NULL;
if (result != OTHER_PROBLEM && new_class != NULL && current_class != NULL) {
// Find the module entry for current_class, the accessor
< prev index next >