diff -r 6c449bdee4fa src/hotspot/share/runtime/reflection.cpp --- a/src/hotspot/share/runtime/reflection.cpp Thu Jul 12 06:04:57 2018 -0700 +++ b/src/hotspot/share/runtime/reflection.cpp Thu Jul 12 15:33:04 2018 +0200 @@ -753,13 +753,16 @@ int ooff = iter.outer_class_info_index(); if (inner_is_member && ioff != 0 && ooff != 0) { - Klass* o = cp->klass_at(ooff, CHECK); - if (o == outer) { - Klass* i = cp->klass_at(ioff, CHECK); - if (i == inner) { - return; - } - } + if (cp->klass_name_at_matches(outer, ooff) && + cp->klass_name_at_matches(inner, ioff)) { + Klass* o = cp->klass_at(ooff, CHECK); + if (o == outer()) { + Klass* i = cp->klass_at(ioff, CHECK); + if (i == inner()) { + return; + } + } + } } if (!inner_is_member && ioff != 0 && ooff == 0 && cp->klass_name_at_matches(inner, ioff)) {