@@ -2151,6 +2151,9 @@ bool WhiteBox::lookup_bool(const char* field_name, oop object) {
21512151
21522152void WhiteBox::register_methods (JNIEnv* env, jclass wbclass, JavaThread* thread, JNINativeMethod* method_array, int method_count) {
21532153 ResourceMark rm;
2154+ Klass* klass = java_lang_Class::as_Klass (JNIHandles::resolve_non_null (wbclass));
2155+ const char * klass_name = klass->external_name ();
2156+
21542157 ThreadToNativeFromVM ttnfv (thread); // can't be in VM when we call JNI
21552158
21562159 // one by one registration natives for exception catching
@@ -2166,13 +2169,13 @@ void WhiteBox::register_methods(JNIEnv* env, jclass wbclass, JavaThread* thread,
21662169 if (env->IsInstanceOf (throwable_obj, no_such_method_error_klass)) {
21672170 // NoSuchMethodError is thrown when a method can't be found or a method is not native.
21682171 // Ignoring the exception since it is not preventing use of other WhiteBox methods.
2169- tty->print_cr (" Warning: 'NoSuchMethodError' on register of sun.hotspot.WhiteBox ::%s%s" ,
2170- method_array[i].name , method_array[i].signature );
2172+ tty->print_cr (" Warning: 'NoSuchMethodError' on register of %s ::%s%s" ,
2173+ klass_name, method_array[i].name , method_array[i].signature );
21712174 }
21722175 } else {
21732176 // Registration failed unexpectedly.
2174- tty->print_cr (" Warning: unexpected error on register of sun.hotspot.WhiteBox ::%s%s. All methods will be unregistered" ,
2175- method_array[i].name , method_array[i].signature );
2177+ tty->print_cr (" Warning: unexpected error on register of %s ::%s%s. All methods will be unregistered" ,
2178+ klass_name, method_array[i].name , method_array[i].signature );
21762179 env->UnregisterNatives (wbclass);
21772180 break ;
21782181 }
@@ -2387,7 +2390,7 @@ static JNINativeMethod methods[] = {
23872390 {CC " countAliveClasses0" , CC " (Ljava/lang/String;)I" , (void *)&WB_CountAliveClasses },
23882391 {CC " getSymbolRefcount" , CC " (Ljava/lang/String;)I" , (void *)&WB_GetSymbolRefcount },
23892392 {CC " parseCommandLine0" ,
2390- CC " (Ljava/lang/String;C[Lsun/hotspot /parser/DiagnosticCommand;)[Ljava/lang/Object;" ,
2393+ CC " (Ljava/lang/String;C[Ljdk/test/whitebox /parser/DiagnosticCommand;)[Ljava/lang/Object;" ,
23912394 (void *) &WB_ParseCommandLine
23922395 },
23932396 {CC " addToBootstrapClassLoaderSearch0" , CC " (Ljava/lang/String;)V" ,
0 commit comments