Skip to content
Permalink
Browse files
8248251: don't all java.lang.IdentityObject to be redefined or retrans…
Reviewed-by: fparain
  • Loading branch information
Harold Seigel committed Jun 25, 2020
1 parent d39d420 commit 925f78ddd149f0a4b7da4df24adf1ee276c27735
Showing 2 changed files with 10 additions and 1 deletion.
@@ -292,6 +292,11 @@ bool VM_RedefineClasses::is_modifiable_class(oop klass_mirror) {
return false;
}

// Cannot redefine or retransform interface java.lang.IdentityObject.
if (k->name() == vmSymbols::java_lang_IdentityObject()) {
return false;
}

// Cannot redefine or retransform a hidden or an unsafe anonymous class.
if (InstanceKlass::cast(k)->is_hidden() ||
InstanceKlass::cast(k)->is_unsafe_anonymous()) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2020, 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
@@ -60,6 +60,10 @@
System.err.println("Error: primitive class returned as modifiable: " + klass);
fail = true;
}
if (isMod && klass == java.lang.IdentityObject.class) {
System.err.println("Error: java.lang.IdentityObject class returned as modifiable: " + klass);
fail = true;
}
try {
instrumentation.retransformClasses(klass);
if (!isMod) {

0 comments on commit 925f78d

Please sign in to comment.