< prev index next >

src/hotspot/share/oops/constantPool.cpp

Print this page




 743   // Dig out the detailed message to reuse if possible
 744   Symbol* message = java_lang_Throwable::detail_message(pending_exception);
 745   if (message != NULL) {
 746     return message;
 747   }
 748 
 749   // Return specific message for the tag
 750   switch (tag.value()) {
 751   case JVM_CONSTANT_UnresolvedClass:
 752     // return the class name in the error message
 753     message = this_cp->klass_name_at(which);
 754     break;
 755   case JVM_CONSTANT_MethodHandle:
 756     // return the method handle name in the error message
 757     message = this_cp->method_handle_name_ref_at(which);
 758     break;
 759   case JVM_CONSTANT_MethodType:
 760     // return the method type signature in the error message
 761     message = this_cp->method_type_signature_at(which);
 762     break;




 763   default:
 764     ShouldNotReachHere();
 765   }
 766 
 767   return message;
 768 }
 769 
 770 void ConstantPool::throw_resolution_error(const constantPoolHandle& this_cp, int which, TRAPS) {
 771   Symbol* message = NULL;
 772   Symbol* error = SystemDictionary::find_resolution_error(this_cp, which, &message);
 773   assert(error != NULL, "checking");
 774   CLEAR_PENDING_EXCEPTION;
 775   if (message != NULL) {
 776     ResourceMark rm;
 777     THROW_MSG(error, message->as_C_string());
 778   } else {
 779     THROW(error);
 780   }
 781 }
 782 




 743   // Dig out the detailed message to reuse if possible
 744   Symbol* message = java_lang_Throwable::detail_message(pending_exception);
 745   if (message != NULL) {
 746     return message;
 747   }
 748 
 749   // Return specific message for the tag
 750   switch (tag.value()) {
 751   case JVM_CONSTANT_UnresolvedClass:
 752     // return the class name in the error message
 753     message = this_cp->klass_name_at(which);
 754     break;
 755   case JVM_CONSTANT_MethodHandle:
 756     // return the method handle name in the error message
 757     message = this_cp->method_handle_name_ref_at(which);
 758     break;
 759   case JVM_CONSTANT_MethodType:
 760     // return the method type signature in the error message
 761     message = this_cp->method_type_signature_at(which);
 762     break;
 763   case JVM_CONSTANT_Dynamic:
 764     // return the name of the condy in the error message
 765     message = this_cp->uncached_name_ref_at(which);
 766     break;
 767   default:
 768     ShouldNotReachHere();
 769   }
 770 
 771   return message;
 772 }
 773 
 774 void ConstantPool::throw_resolution_error(const constantPoolHandle& this_cp, int which, TRAPS) {
 775   Symbol* message = NULL;
 776   Symbol* error = SystemDictionary::find_resolution_error(this_cp, which, &message);
 777   assert(error != NULL, "checking");
 778   CLEAR_PENDING_EXCEPTION;
 779   if (message != NULL) {
 780     ResourceMark rm;
 781     THROW_MSG(error, message->as_C_string());
 782   } else {
 783     THROW(error);
 784   }
 785 }
 786 


< prev index next >