src/hotspot/share/runtime/reflection.cpp
changeset 52096 7a1e2d7ac55a
parent 51807 3221f5e14866
child 52195 f08c1d7a5c53
equal deleted inserted replaced
52095:c459186b9584 52096:7a1e2d7ac55a
   748 void Reflection::check_for_inner_class(const InstanceKlass* outer, const InstanceKlass* inner,
   748 void Reflection::check_for_inner_class(const InstanceKlass* outer, const InstanceKlass* inner,
   749                                        bool inner_is_member, TRAPS) {
   749                                        bool inner_is_member, TRAPS) {
   750   InnerClassesIterator iter(outer);
   750   InnerClassesIterator iter(outer);
   751   constantPoolHandle cp   (THREAD, outer->constants());
   751   constantPoolHandle cp   (THREAD, outer->constants());
   752   for (; !iter.done(); iter.next()) {
   752   for (; !iter.done(); iter.next()) {
   753      int ioff = iter.inner_class_info_index();
   753     int ioff = iter.inner_class_info_index();
   754      int ooff = iter.outer_class_info_index();
   754     int ooff = iter.outer_class_info_index();
   755 
   755 
   756      if (inner_is_member && ioff != 0 && ooff != 0) {
   756     if (inner_is_member && ioff != 0 && ooff != 0) {
       
   757       if (cp->klass_name_at_matches(outer, ooff) &&
       
   758           cp->klass_name_at_matches(inner, ioff)) {
   757         Klass* o = cp->klass_at(ooff, CHECK);
   759         Klass* o = cp->klass_at(ooff, CHECK);
   758         if (o == outer) {
   760         if (o == outer) {
   759           Klass* i = cp->klass_at(ioff, CHECK);
   761           Klass* i = cp->klass_at(ioff, CHECK);
   760           if (i == inner) {
   762           if (i == inner) {
   761             return;
   763             return;
   762           }
   764           }
   763         }
   765         }
   764      }
   766       }
   765      if (!inner_is_member && ioff != 0 && ooff == 0 &&
   767     }
   766          cp->klass_name_at_matches(inner, ioff)) {
   768 
   767         Klass* i = cp->klass_at(ioff, CHECK);
   769     if (!inner_is_member && ioff != 0 && ooff == 0 &&
   768         if (i == inner) {
   770         cp->klass_name_at_matches(inner, ioff)) {
   769           return;
   771       Klass* i = cp->klass_at(ioff, CHECK);
   770         }
   772       if (i == inner) {
   771      }
   773         return;
       
   774       }
       
   775     }
   772   }
   776   }
   773 
   777 
   774   // 'inner' not declared as an inner klass in outer
   778   // 'inner' not declared as an inner klass in outer
   775   ResourceMark rm(THREAD);
   779   ResourceMark rm(THREAD);
   776   Exceptions::fthrow(
   780   Exceptions::fthrow(