589 // If inner_is_member, require the inner to be a member of the outer. |
589 // If inner_is_member, require the inner to be a member of the outer. |
590 // If !inner_is_member, require the inner to be anonymous (a non-member). |
590 // If !inner_is_member, require the inner to be anonymous (a non-member). |
591 // Caller is responsible for figuring out in advance which case must be true. |
591 // Caller is responsible for figuring out in advance which case must be true. |
592 void Reflection::check_for_inner_class(instanceKlassHandle outer, instanceKlassHandle inner, |
592 void Reflection::check_for_inner_class(instanceKlassHandle outer, instanceKlassHandle inner, |
593 bool inner_is_member, TRAPS) { |
593 bool inner_is_member, TRAPS) { |
594 const int inner_class_info_index = 0; |
594 InnerClassesIterator iter(outer); |
595 const int outer_class_info_index = 1; |
|
596 |
|
597 typeArrayHandle icls (THREAD, outer->inner_classes()); |
|
598 constantPoolHandle cp (THREAD, outer->constants()); |
595 constantPoolHandle cp (THREAD, outer->constants()); |
599 for(int i = 0; i < icls->length(); i += 4) { |
596 for (; !iter.done(); iter.next()) { |
600 int ioff = icls->ushort_at(i + inner_class_info_index); |
597 int ioff = iter.inner_class_info_index(); |
601 int ooff = icls->ushort_at(i + outer_class_info_index); |
598 int ooff = iter.outer_class_info_index(); |
602 |
599 |
603 if (inner_is_member && ioff != 0 && ooff != 0) { |
600 if (inner_is_member && ioff != 0 && ooff != 0) { |
604 klassOop o = cp->klass_at(ooff, CHECK); |
601 klassOop o = cp->klass_at(ooff, CHECK); |
605 if (o == outer()) { |
602 if (o == outer()) { |
606 klassOop i = cp->klass_at(ioff, CHECK); |
603 klassOop i = cp->klass_at(ioff, CHECK); |