summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Matthias Jaros <jarlucmat@mailbox.org>2026-08-31 12:39:13 +0200
committerGravatar Matthias Jaros <jarlucmat@mailbox.org>2026-08-31 12:39:13 +0200
commit1bda29ee82642c39febec9a9a61100377d250278 (patch)
tree7abd9bb9848902f3ceb56322dd16299fa4984af8 /src/main/java
parentac649d2b2f84923da29ea5ce14ee0247086dc33d (diff)
Added explizit target types to generic method
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/it_jaros/jns/scan/engine/platform/linux/LinuxUdpSocketAPI.java10
1 files 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> 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.<Integer>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.<Long>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.<Long>wrapNativeMethodCall(RECV, fd, buffer, buffer.byteSize(), 0);
}
public void setReceiveTimeout(int fd, long timeoutInMillis) throws IOException {