Skip to content

Commit

Permalink
Fix new IDEA insepections
Browse files Browse the repository at this point in the history
  • Loading branch information
bwRavencl committed Dec 6, 2023
1 parent aac3102 commit d84312b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public EditActionsDialog(
setTitle(MessageFormat.format(Main.strings.getString("EDIT_ACTIONS_DIALOG_TITLE_COMPONENT_EDITOR"), name));

final var modes = unsavedProfile.getModes();
selectedMode = modes.get(0);
selectedMode = modes.getFirst();
GuiUtils.addModePanel(getContentPane(), modes, new AbstractAction() {

@Serial
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/bwravencl/controllerbuddy/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ public void windowOpened(final WindowEvent e) {
},
() -> {
log.log(Level.INFO, "Previously used controller is not present");
setSelectedController(presentControllers.get(0));
setSelectedController(presentControllers.getFirst());
});
}
}
Expand Down Expand Up @@ -2209,7 +2209,7 @@ private void onControllersChanged(final List<ControllerInfo> presentControllers,
if (!controllerConnected) {
selectedController = null;
} else if (selectedController == null) {
setSelectedControllerAndUpdateInput(presentControllers.get(0), null);
setSelectedControllerAndUpdateInput(presentControllers.getFirst(), null);
updateTitleAndTooltip();

if (isAutoRestartOutput()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,7 @@ private void updateOverlay(final long overlayHandle, final Frame frame) {
checkOverlayError(VROverlay.VROverlay_ShowOverlay(overlayHandle));

if (VROverlay.VROverlay_IsOverlayVisible(overlayHandle)) {
var textureData = textureDataCache.get(overlayHandle);
if (textureData == null) {
textureData = new TextureData();
textureDataCache.put(overlayHandle, textureData);
}
final var textureData = textureDataCache.computeIfAbsent(overlayHandle, k -> new TextureData());

final var imageResized = textureData.image == null
|| textureData.image.getWidth() != frame.getWidth()
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/bwravencl/controllerbuddy/input/Input.java
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ public boolean poll() {
}

if (actions == null) {
actions = modes.get(0).getAxisToActionsMap().get(axis);
actions = modes.getFirst().getAxisToActionsMap().get(axis);
}

if (actions != null) {
Expand Down Expand Up @@ -497,7 +497,7 @@ public boolean poll() {
}

if (actions == null) {
actions = modes.get(0).getButtonToActionsMap().get(button);
actions = modes.getFirst().getButtonToActionsMap().get(button);
}

if (actions != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private void deactivateMode(final Input input, final Profile profile) {
if (previousButtonToModeAction != null) {
previousMode = previousButtonToModeAction.getMode(input);
} else {
previousMode = profile.getModes().get(0);
previousMode = profile.getModes().getFirst();
}

final var activeMode = profile.getActiveMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public Driver getIfAvailable(
}

try {
return new EvdevDriver(input, selectedController, evdevInfos.get(0));
return new EvdevDriver(input, selectedController, evdevInfos.getFirst());
} catch (final IOException e) {
log.log(Level.SEVERE, e.getMessage(), e);
}
Expand Down

0 comments on commit d84312b

Please sign in to comment.