Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit e97a269

Browse files
committed
jpy_jtype.c: Use getMethods instead of getDeclaredMethods.
Java 8 interfaces may have default methods. When using getMethods up the inheritance stack, jpy wil never find them. By using getDeclaredMethods instead, jpy is able to find the default methods and properly invoke them.
1 parent fff4004 commit e97a269

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/c/jpy_jtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ int JType_ProcessClassMethods(JNIEnv* jenv, JPy_JType* type)
10751075
if (type->isInterface) {
10761076
methods = (*jenv)->CallObjectMethod(jenv, classRef, JPy_Class_GetMethods_MID);
10771077
} else {
1078-
methods = (*jenv)->CallObjectMethod(jenv, classRef, JPy_Class_GetDeclaredMethods_MID);
1078+
methods = (*jenv)->CallObjectMethod(jenv, classRef, JPy_Class_GetMethods_MID);
10791079
}
10801080
methodCount = (*jenv)->GetArrayLength(jenv, methods);
10811081

0 commit comments

Comments
 (0)