mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8145964: NoClassDefFound error in transforming lambdas
Skip VM anonymous classes in retransformation and give an error for redefinition. Reviewed-by: dholmes, dcubed, never
This commit is contained in:
parent
5868fdc4b7
commit
85381e59e5
4 changed files with 197 additions and 15 deletions
|
@ -130,7 +130,7 @@ bool VM_RedefineClasses::doit_prologue() {
|
|||
}
|
||||
|
||||
oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass);
|
||||
// classes for primitives and arrays cannot be redefined
|
||||
// classes for primitives and arrays and vm anonymous classes cannot be redefined
|
||||
// check here so following code can assume these classes are InstanceKlass
|
||||
if (!is_modifiable_class(mirror)) {
|
||||
_res = JVMTI_ERROR_UNMODIFIABLE_CLASS;
|
||||
|
@ -250,9 +250,14 @@ bool VM_RedefineClasses::is_modifiable_class(oop klass_mirror) {
|
|||
if (java_lang_Class::is_primitive(klass_mirror)) {
|
||||
return false;
|
||||
}
|
||||
Klass* the_class_oop = java_lang_Class::as_Klass(klass_mirror);
|
||||
Klass* k = java_lang_Class::as_Klass(klass_mirror);
|
||||
// classes for arrays cannot be redefined
|
||||
if (the_class_oop == NULL || !the_class_oop->is_instance_klass()) {
|
||||
if (k == NULL || !k->is_instance_klass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Cannot redefine or retransform an anonymous class.
|
||||
if (InstanceKlass::cast(k)->is_anonymous()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue