From 1bda29ee82642c39febec9a9a61100377d250278 Mon Sep 17 00:00:00 2001 From: Matthias Jaros Date: Mon, 31 Aug 2026 12:39:13 +0200 Subject: Added explizit target types to generic method --- .../jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java b/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java index bbd2009..3f05b67 100644 --- a/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java +++ b/src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java @@ -125,7 +125,7 @@ public class LinuxUdpSocketAPI { } } - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({"unchecked"}) private T callNativeMethod(MethodHandle methodHandle, Object... args) throws NativeCallException { try { return (T) methodHandle.invokeWithArguments(args); @@ -135,20 +135,20 @@ public class LinuxUdpSocketAPI { } public int socket(int family) throws IOException { - return wrapNativeMethodCall(SOCKET, family, SOCK_DGRAM, 0); + return this.wrapNativeMethodCall(SOCKET, family, SOCK_DGRAM, 0); } public void connect(int fd, MemorySegment destination) throws IOException { wrapNativeMethodCall(CONNECT, fd, destination, (int) destination.byteSize()); } - public void sendEmptyDatagram(int fd) throws IOException { + public long sendEmptyDatagram(int fd) throws IOException { MemorySegment buffer = arena.allocate(1L); - wrapNativeMethodCall(SEND, fd, buffer, buffer.byteSize(), 0); + return this.wrapNativeMethodCall(SEND, fd, buffer, buffer.byteSize(), 0); } public long recv(int fd, MemorySegment buffer) throws IOException { - return wrapNativeMethodCall(RECV, fd, buffer, buffer.byteSize(), 0); + return this.wrapNativeMethodCall(RECV, fd, buffer, buffer.byteSize(), 0); } public void setReceiveTimeout(int fd, long timeoutInMillis) throws IOException { -- cgit v1.3.1-4-g156e