Skip to content

Support Default Methods on interfaces #813

@Master-01

Description

@Master-01

Hellow!

I use Java8 interface
public static interface IKernelApiAll extends Kernel32
{
@Override public HANDLE GetCurrentThread();
public int SetThreadAffinityMask(final Pointer hThread, final int dwThreadAffinityMask);
default public int SetCurrentThreadAffinityMask(final int dwThreadAffinityMask) { return SetThreadAffinityMask(GetCurrentThread().getPointer(), dwThreadAffinityMask); }
}
when call SetCurrentThreadAffinityMask(0) I get an error
Exception in thread "thread1" java.lang.UnsatisfiedLinkError: Error looking up function 'SetCurrentThreadAffinityMask': not found procedure
at com.sun.jna.Function.(Function.java:245)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:566)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:542)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:528)
at com.sun.jna.Library$Handler.invoke(Library.java:228)
at com.sun.proxy.$Proxy8.SetCurrentThreadAffinityMask(Unknown Source)

Why JNA is trying to find a procedure in the DLL if the keyword is specified in the declaration as default.
The default functions should simply be ignored for find prodedure procedures in the DLL, and simple execute default java code!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions