Skip to content

Commit e5dcbed

Browse files
committed
Fix / suppress expected warnings
1 parent d324e2d commit e5dcbed

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

src/main/java/de/bwravencl/controllerbuddy/ffi/Kernel32.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.lang.foreign.ValueLayout;
2424
import java.lang.invoke.MethodHandle;
2525

26-
@SuppressWarnings("exports")
26+
@SuppressWarnings({ "exports", "restricted" })
2727
public final class Kernel32 {
2828

2929
private static final Linker LINKER = Linker.nativeLinker();

src/main/java/de/bwravencl/controllerbuddy/ffi/Linux.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.lang.invoke.MethodHandle;
2727
import java.lang.invoke.VarHandle;
2828

29-
@SuppressWarnings({ "exports", "SameParameterValue" })
29+
@SuppressWarnings({ "exports", "restricted", "SameParameterValue" })
3030
public final class Linux {
3131

3232
public static final int O_NONBLOCK = 4000;

src/main/java/de/bwravencl/controllerbuddy/ffi/User32.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import java.lang.invoke.MethodHandle;
2929
import java.lang.invoke.VarHandle;
3030

31-
@SuppressWarnings({ "exports", "UnusedReturnValue" })
31+
@SuppressWarnings({ "exports", "restricted", "UnusedReturnValue" })
3232
public final class User32 {
3333

3434
public static final MemorySegment HWND_TOPMOST = MemorySegment.ofAddress(-1L);

src/main/java/de/bwravencl/controllerbuddy/ffi/VjoyInterface.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.util.logging.Level;
3030
import java.util.logging.Logger;
3131

32-
@SuppressWarnings("exports")
32+
@SuppressWarnings({ "exports", "restricted" })
3333
public final class VjoyInterface {
3434

3535
public static final int HID_USAGE_RX = 0x33;

src/main/java/de/bwravencl/controllerbuddy/gui/OnScreenKeyboard.java

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public final class OnScreenKeyboard extends JFrame {
8080
@SuppressWarnings({ "serial", "RedundantSuppression" })
8181
private final FrameDragListener frameDragListener;
8282

83+
@SuppressWarnings({ "serial", "RedundantSuppression" })
8384
private final Set<AbstractKeyboardButton> heldButtons = ConcurrentHashMap.newKeySet();
8485

8586
private final AbstractKeyboardButton[][] keyboardButtons;

src/main/java/de/bwravencl/controllerbuddy/runmode/UinputDevice.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.nio.file.Path;
3232
import java.nio.file.Paths;
3333
import java.util.Arrays;
34+
import java.util.Set;
3435
import java.util.logging.Level;
3536
import java.util.logging.Logger;
3637
import java.util.stream.Stream;
@@ -162,17 +163,18 @@ public String toString() {
162163
return name;
163164
}
164165

166+
@SuppressWarnings("ImmutableEnumChecker")
165167
enum DeviceType {
166168

167169
JOYSTICK(Event.JOYSTICK_EVENTS), KEYBOARD(Event.KEYBOARD_EVENTS), MOUSE(Event.MOUSE_EVENTS);
168170

169171
private final String name;
170172

171-
private final Event[] supportedEvents;
173+
private final Set<Event> supportedEvents;
172174

173175
DeviceType(final Event[] supportedEvents) {
174176
name = "Constants.APPLICATION_NAME " + name();
175-
this.supportedEvents = supportedEvents;
177+
this.supportedEvents = Set.of(supportedEvents);
176178
}
177179
}
178180

0 commit comments

Comments
 (0)