diff -r cdffba164671 -r 3e5d28e6de32 src/hotspot/share/oops/instanceMirrorKlass.inline.hpp --- a/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp Mon Aug 20 10:04:00 2018 +0200 +++ b/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp Mon Aug 20 08:25:57 2018 -0400 @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2018, 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 @@ -51,9 +51,10 @@ Klass* klass = java_lang_Class::as_Klass(obj); // We'll get NULL for primitive mirrors. if (klass != NULL) { - if (klass->is_instance_klass() && InstanceKlass::cast(klass)->is_anonymous()) { - // An anonymous class doesn't have its own class loader, so when handling - // the java mirror for an anonymous class we need to make sure its class + if (klass->is_instance_klass() && + InstanceKlass::cast(klass)->is_unsafe_anonymous()) { + // An unsafe anonymous class doesn't have its own class loader, so + // when handling the java mirror for the class we need to make sure its class // loader data is claimed, this is done by calling do_cld explicitly. // For non-anonymous classes the call to do_cld is made when the class // loader itself is handled.