--- old/src/hotspot/share/classfile/defaultMethods.cpp 2018-04-04 11:55:26.595395028 -0400 +++ new/src/hotspot/share/classfile/defaultMethods.cpp 2018-04-04 11:55:25.946965017 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -884,6 +884,10 @@ if (new_methods->length() > 0) { ConstantPool* cp = bpool->create_constant_pool(CHECK); if (cp != klass->constants()) { + // Copy resolved anonymous class into new constant pool. + if (klass->is_anonymous()) { + cp->klass_at_put(klass->this_class_index(), klass); + } klass->class_loader_data()->add_to_deallocate_list(klass->constants()); klass->set_constants(cp); cp->set_pool_holder(klass);