--- old/src/share/vm/classfile/defaultMethods.cpp 2013-01-30 19:58:04.115466246 -0800 +++ new/src/share/vm/classfile/defaultMethods.cpp 2013-01-30 19:58:03.883454646 -0800 @@ -721,6 +721,18 @@ _ctx->apply_type_arguments(sub, klass, THREAD); + // apply_type_arguments may result in a ClassCirculatoryError + // exception while constructing a ClassDescriptor for klass. In + // such a situation, it indicates that _method_name can not be + // found in the hierarchy currently being traversed. Clear the + // exception and return to continue. + if (HAS_PENDING_EXCEPTION) { + if (PENDING_EXCEPTION->klass()->name() == vmSymbols::java_lang_ClassCircularityError()) { + CLEAR_PENDING_EXCEPTION; + return true; + } + } + int start, end = 0; start = klass->find_method_by_name(_method_name, &end); if (start != -1) { @@ -730,6 +742,19 @@ // parameters resolved generic::MethodDescriptor* md = _cache->descriptor_for(m, THREAD); + // Attempt to get the class descriptor of the method may + // result in a ClassCirculatoryError exception while + // constructing a ClassDescriptor for the holder of m. In such + // a situation, it indicates that m can not be found in the + // hierarchy currently being traversed and md is NULL. Clear + // the exception and return to continue. + + if (HAS_PENDING_EXCEPTION) { + if (PENDING_EXCEPTION->klass()->name() == vmSymbols::java_lang_ClassCircularityError()) { + CLEAR_PENDING_EXCEPTION; + return true; + } + } // Find all methods on this hierarchy that match this method // (name, signature). This class collects other families of this // method name.