Browse Source

Fixed JNM#getFunctionalInterfaceMethod

Now it doesn't select the first nondefault method but the first public nondefault method
kindlich 4 years ago
parent
commit
a96a0f41c0
No known key found for this signature in database

+ 1
- 1
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java View File

@@ -1000,7 +1000,7 @@ public class JavaNativeModule {
1000 1000
 
1001 1001
 	private Method getFunctionalInterfaceMethod(Class<?> functionalInterface) {
1002 1002
 		for (Method method : functionalInterface.getDeclaredMethods()) {
1003
-			if (!method.isDefault())
1003
+			if (Modifier.isPublic(method.getModifiers()) && !method.isDefault())
1004 1004
 				return method;
1005 1005
 		}
1006 1006
 

Loading…
Cancel
Save