@@ -691,7 +691,7 @@ JVM_ENTRY(jobject, JVM_Clone(JNIEnv* env, jobject handle))
691691 (klass->is_instance_klass () &&
692692 InstanceKlass::cast(klass)->reference_type() != REF_NONE)) {
693693 ResourceMark rm (THREAD);
694- THROW_MSG_0 (vmSymbols::java_lang_CloneNotSupportedException (), klass->external_name ());
694+ THROW_MSG_NULL (vmSymbols::java_lang_CloneNotSupportedException (), klass->external_name ());
695695 }
696696
697697 // Make shallow object copy
@@ -791,7 +791,7 @@ JVM_ENTRY(jclass, JVM_FindPrimitiveClass(JNIEnv* env, const char* utf))
791791 mirror = Universe::java_mirror (t);
792792 }
793793 if (mirror == nullptr ) {
794- THROW_MSG_0 (vmSymbols::java_lang_ClassNotFoundException (), (char *) utf);
794+ THROW_MSG_NULL (vmSymbols::java_lang_ClassNotFoundException (), (char *) utf);
795795 } else {
796796 return (jclass) JNIHandles::make_local (THREAD, mirror);
797797 }
@@ -952,7 +952,7 @@ static jclass jvm_lookup_define_class(jclass lookup, const char *name,
952952 Klass* lookup_k = java_lang_Class::as_Klass (JNIHandles::resolve_non_null (lookup));
953953 // Lookup class must be a non-null instance
954954 if (lookup_k == nullptr ) {
955- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Lookup class is null" );
955+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Lookup class is null" );
956956 }
957957 assert (lookup_k->is_instance_klass (), " Lookup class must be an instance klass" );
958958
@@ -979,20 +979,20 @@ static jclass jvm_lookup_define_class(jclass lookup, const char *name,
979979 if (!is_hidden) {
980980 // classData is only applicable for hidden classes
981981 if (classData != nullptr ) {
982- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " classData is only applicable for hidden classes" );
982+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " classData is only applicable for hidden classes" );
983983 }
984984 if (is_nestmate) {
985- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " dynamic nestmate is only applicable for hidden classes" );
985+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " dynamic nestmate is only applicable for hidden classes" );
986986 }
987987 if (!is_strong) {
988- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " an ordinary class must be strongly referenced by its defining loader" );
988+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " an ordinary class must be strongly referenced by its defining loader" );
989989 }
990990 if (vm_annotations) {
991- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " vm annotations only allowed for hidden classes" );
991+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " vm annotations only allowed for hidden classes" );
992992 }
993993 if (flags != STRONG_LOADER_LINK) {
994- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (),
995- err_msg (" invalid flag 0x%x" , flags));
994+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (),
995+ err_msg (" invalid flag 0x%x" , flags));
996996 }
997997 }
998998
@@ -1047,7 +1047,7 @@ static jclass jvm_lookup_define_class(jclass lookup, const char *name,
10471047
10481048 if ((!is_hidden || is_nestmate) && !Reflection::is_same_class_package (lookup_k, ik)) {
10491049 // non-hidden class or nestmate class must be in the same package as the Lookup class
1050- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Lookup class and defined class are in different packages" );
1050+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Lookup class and defined class are in different packages" );
10511051 }
10521052
10531053 if (init) {
@@ -1078,7 +1078,7 @@ JVM_ENTRY(jclass, JVM_LookupDefineClass(JNIEnv *env, jclass lookup, const char *
10781078 jsize len, jobject pd, jboolean initialize, int flags, jobject classData))
10791079
10801080 if (lookup == nullptr ) {
1081- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Lookup class is null" );
1081+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Lookup class is null" );
10821082 }
10831083
10841084 assert (buf != nullptr , " buf must not be null" );
@@ -1703,8 +1703,8 @@ JVM_ENTRY(jobjectArray, JVM_GetMethodParameters(JNIEnv *env, jobject method))
17031703 bounds_check (cp, index, CHECK_NULL);
17041704
17051705 if (0 != index && !mh->constants ()->tag_at (index).is_utf8 ()) {
1706- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (),
1707- " Wrong type at constant pool index" );
1706+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (),
1707+ " Wrong type at constant pool index" );
17081708 }
17091709
17101710 }
@@ -2133,7 +2133,7 @@ JVM_ENTRY(jclass, JVM_ConstantPoolGetClassAt(JNIEnv *env, jobject obj, jobject u
21332133 bounds_check (cp, index, CHECK_NULL);
21342134 constantTag tag = cp->tag_at (index);
21352135 if (!tag.is_klass () && !tag.is_unresolved_klass ()) {
2136- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2136+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
21372137 }
21382138 Klass* k = cp->klass_at (index, CHECK_NULL);
21392139 return (jclass) JNIHandles::make_local (THREAD, k->java_mirror ());
@@ -2146,7 +2146,7 @@ JVM_ENTRY(jclass, JVM_ConstantPoolGetClassAtIfLoaded(JNIEnv *env, jobject obj, j
21462146 bounds_check (cp, index, CHECK_NULL);
21472147 constantTag tag = cp->tag_at (index);
21482148 if (!tag.is_klass () && !tag.is_unresolved_klass ()) {
2149- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2149+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
21502150 }
21512151 Klass* k = ConstantPool::klass_at_if_loaded (cp, index);
21522152 if (k == nullptr ) return nullptr ;
@@ -2157,7 +2157,7 @@ JVM_END
21572157static jobject get_method_at_helper (const constantPoolHandle& cp, jint index, bool force_resolution, TRAPS) {
21582158 constantTag tag = cp->tag_at (index);
21592159 if (!tag.is_method () && !tag.is_interface_method ()) {
2160- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2160+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
21612161 }
21622162 int klass_ref = cp->uncached_klass_ref_index_at (index);
21632163 Klass* k_o;
@@ -2172,7 +2172,7 @@ static jobject get_method_at_helper(const constantPoolHandle& cp, jint index, bo
21722172 Symbol* sig = cp->uncached_signature_ref_at (index);
21732173 methodHandle m (THREAD, k->find_method (name, sig));
21742174 if (m.is_null ()) {
2175- THROW_MSG_0 (vmSymbols::java_lang_RuntimeException (), " Unable to look up method in target class" );
2175+ THROW_MSG_NULL (vmSymbols::java_lang_RuntimeException (), " Unable to look up method in target class" );
21762176 }
21772177 oop method;
21782178 if (!m->is_initializer () || m->is_static ()) {
@@ -2206,7 +2206,7 @@ JVM_END
22062206static jobject get_field_at_helper (constantPoolHandle cp, jint index, bool force_resolution, TRAPS) {
22072207 constantTag tag = cp->tag_at (index);
22082208 if (!tag.is_field ()) {
2209- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2209+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
22102210 }
22112211 int klass_ref = cp->uncached_klass_ref_index_at (index);
22122212 Klass* k_o;
@@ -2222,7 +2222,7 @@ static jobject get_field_at_helper(constantPoolHandle cp, jint index, bool force
22222222 fieldDescriptor fd;
22232223 Klass* target_klass = k->find_field (name, sig, &fd);
22242224 if (target_klass == nullptr ) {
2225- THROW_MSG_0 (vmSymbols::java_lang_RuntimeException (), " Unable to look up field in target class" );
2225+ THROW_MSG_NULL (vmSymbols::java_lang_RuntimeException (), " Unable to look up field in target class" );
22262226 }
22272227 oop field = Reflection::new_field (&fd, CHECK_NULL);
22282228 return JNIHandles::make_local (THREAD, field);
@@ -2255,7 +2255,7 @@ JVM_ENTRY(jobjectArray, JVM_ConstantPoolGetMemberRefInfoAt(JNIEnv *env, jobject
22552255 bounds_check (cp, index, CHECK_NULL);
22562256 constantTag tag = cp->tag_at (index);
22572257 if (!tag.is_field_or_method ()) {
2258- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2258+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
22592259 }
22602260 int klass_ref = cp->uncached_klass_ref_index_at (index);
22612261 Symbol* klass_name = cp->klass_name_at (klass_ref);
@@ -2306,7 +2306,7 @@ JVM_ENTRY(jobjectArray, JVM_ConstantPoolGetNameAndTypeRefInfoAt(JNIEnv *env, job
23062306 bounds_check (cp, index, CHECK_NULL);
23072307 constantTag tag = cp->tag_at (index);
23082308 if (!tag.is_name_and_type ()) {
2309- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2309+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
23102310 }
23112311 Symbol* member_name = cp->symbol_at (cp->name_ref_index_at (index));
23122312 Symbol* member_sig = cp->symbol_at (cp->signature_ref_index_at (index));
@@ -2374,7 +2374,7 @@ JVM_ENTRY(jstring, JVM_ConstantPoolGetStringAt(JNIEnv *env, jobject obj, jobject
23742374 bounds_check (cp, index, CHECK_NULL);
23752375 constantTag tag = cp->tag_at (index);
23762376 if (!tag.is_string ()) {
2377- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2377+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
23782378 }
23792379 oop str = cp->string_at (index, CHECK_NULL);
23802380 return (jstring) JNIHandles::make_local (THREAD, str);
@@ -2388,7 +2388,7 @@ JVM_ENTRY(jstring, JVM_ConstantPoolGetUTF8At(JNIEnv *env, jobject obj, jobject u
23882388 bounds_check (cp, index, CHECK_NULL);
23892389 constantTag tag = cp->tag_at (index);
23902390 if (!tag.is_symbol ()) {
2391- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
2391+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Wrong type at constant pool index" );
23922392 }
23932393 Symbol* sym = cp->symbol_at (index);
23942394 Handle str = java_lang_String::create_from_symbol (sym, CHECK_NULL);
@@ -3292,13 +3292,13 @@ JVM_END
32923292// resolve array handle and check arguments
32933293static inline arrayOop check_array (JNIEnv *env, jobject arr, bool type_array_only, TRAPS) {
32943294 if (arr == nullptr ) {
3295- THROW_0 (vmSymbols::java_lang_NullPointerException ());
3295+ THROW_NULL (vmSymbols::java_lang_NullPointerException ());
32963296 }
32973297 oop a = JNIHandles::resolve_non_null (arr);
32983298 if (!a->is_array ()) {
3299- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Argument is not an array" );
3299+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Argument is not an array" );
33003300 } else if (type_array_only && !a->is_typeArray ()) {
3301- THROW_MSG_0 (vmSymbols::java_lang_IllegalArgumentException (), " Argument is not an array of primitive type" );
3301+ THROW_MSG_NULL (vmSymbols::java_lang_IllegalArgumentException (), " Argument is not an array of primitive type" );
33023302 }
33033303 return arrayOop (a);
33043304}
@@ -3535,7 +3535,7 @@ JVM_ENTRY(jobject, JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jo
35353535 }
35363536 return res;
35373537 } else {
3538- THROW_0 (vmSymbols::java_lang_StackOverflowError ());
3538+ THROW_NULL (vmSymbols::java_lang_StackOverflowError ());
35393539 }
35403540JVM_END
35413541
0 commit comments