@@ -2178,7 +2178,7 @@ C2V_VMENTRY_NULL(jobjectArray, getDeclaredConstructors, (JNIEnv* env, jobject, A
2178
2178
GrowableArray<Method*> constructors_array;
2179
2179
for (int i = 0 ; i < iklass->methods ()->length(); i++) {
2180
2180
Method* m = iklass->methods ()->at (i);
2181
- if (m->is_initializer () && !m-> is_static ()) {
2181
+ if (m->is_object_initializer ()) {
2182
2182
constructors_array.append (m);
2183
2183
}
2184
2184
}
@@ -2205,7 +2205,7 @@ C2V_VMENTRY_NULL(jobjectArray, getDeclaredMethods, (JNIEnv* env, jobject, ARGUME
2205
2205
GrowableArray<Method*> methods_array;
2206
2206
for (int i = 0 ; i < iklass->methods ()->length(); i++) {
2207
2207
Method* m = iklass->methods ()->at (i);
2208
- if (!m->is_initializer () && !m->is_overpass ()) {
2208
+ if (!m->is_object_initializer () && !m-> is_static_initializer () && !m->is_overpass ()) {
2209
2209
methods_array.append (m);
2210
2210
}
2211
2211
}
@@ -2921,12 +2921,11 @@ C2V_VMENTRY_NULL(jobject, asReflectionExecutable, (JNIEnv* env, jobject, ARGUMEN
2921
2921
requireInHotSpot(" asReflectionExecutable" , JVMCI_CHECK_NULL);
2922
2922
methodHandle m (THREAD, UNPACK_PAIR(Method, method));
2923
2923
oop executable;
2924
- if (m->is_initializer ()) {
2925
- if (m->is_static_initializer ()) {
2926
- JVMCI_THROW_MSG_NULL (IllegalArgumentException,
2927
- " Cannot create java.lang.reflect.Method for class initializer" );
2928
- }
2924
+ if (m->is_object_initializer ()) {
2929
2925
executable = Reflection::new_constructor (m, CHECK_NULL);
2926
+ } else if (m->is_static_initializer ()) {
2927
+ JVMCI_THROW_MSG_NULL (IllegalArgumentException,
2928
+ " Cannot create java.lang.reflect.Method for class initializer" );
2930
2929
} else {
2931
2930
executable = Reflection::new_method (m, false , CHECK_NULL);
2932
2931
}
0 commit comments