From 804aea13004ef776ee87557be0f7c3e43a9b2bf9 Mon Sep 17 00:00:00 2001 From: Kevin Cooney Date: Sun, 7 Jun 2026 18:18:16 -0700 Subject: [PATCH] Address issues found by IntelliJ IDEA inspections --- .../com/team2813/lib2813/util/InvalidCanIdException.java | 7 ++++--- .../team2813/lib2813/util/BuildConstantsPublisherTest.java | 7 ++++--- .../com/team2813/lib2813/limelight/LimelightHelpers.java | 5 +---- .../team2813/lib2813/vendor/ctre/motor/TalonFXWrapper.java | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/team2813/lib2813/util/InvalidCanIdException.java b/core/src/main/java/com/team2813/lib2813/util/InvalidCanIdException.java index 0d06a6ac..86aecaf4 100644 --- a/core/src/main/java/com/team2813/lib2813/util/InvalidCanIdException.java +++ b/core/src/main/java/com/team2813/lib2813/util/InvalidCanIdException.java @@ -41,9 +41,10 @@ public int getCanId() { @Override public boolean equals(Object o) { - if (!(o instanceof InvalidCanIdException)) return false; - InvalidCanIdException other = (InvalidCanIdException) o; - return getMessage().equals(other.getMessage()); + if (o instanceof InvalidCanIdException other) { + return getMessage().equals(other.getMessage()); + } + return false; } @Override diff --git a/core/src/test/java/com/team2813/lib2813/util/BuildConstantsPublisherTest.java b/core/src/test/java/com/team2813/lib2813/util/BuildConstantsPublisherTest.java index cba34401..a2db1dad 100644 --- a/core/src/test/java/com/team2813/lib2813/util/BuildConstantsPublisherTest.java +++ b/core/src/test/java/com/team2813/lib2813/util/BuildConstantsPublisherTest.java @@ -41,7 +41,7 @@ public class BuildConstantsPublisherTest { // Fake constants copied and adapted from this article // https://docs.wpilib.org/en/stable/docs/software/advanced-gradlerio/deploy-git-data.html - public final class FakeBuildConstants { + public static final class FakeBuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "2813Robot"; public static final String VERSION = "unspecified"; @@ -60,9 +60,10 @@ private FakeBuildConstants() {} * A Truth {@link Subject} for asserting properties of strings that should parse as {@link * LocalDateTime}. * - *

Composed with the help of Gemini: https://g.co/gemini/share/d8db68a8fbaf + *

Composed with the help of Gemini: thread */ - private class DateTimeStringSubject extends Subject { + private static class DateTimeStringSubject extends Subject { private final String actual; private DateTimeStringSubject(FailureMetadata metadata, String actual) { diff --git a/limelight/src/main/java/com/team2813/lib2813/limelight/LimelightHelpers.java b/limelight/src/main/java/com/team2813/lib2813/limelight/LimelightHelpers.java index 7696ce78..413e78ae 100644 --- a/limelight/src/main/java/com/team2813/lib2813/limelight/LimelightHelpers.java +++ b/limelight/src/main/java/com/team2813/lib2813/limelight/LimelightHelpers.java @@ -1645,10 +1645,7 @@ public static double[] getPythonScriptData(String limelightName) { /** Asynchronously take snapshot. */ public static CompletableFuture takeSnapshot(String tableName, String snapshotName) { - return CompletableFuture.supplyAsync( - () -> { - return SYNCH_TAKESNAPSHOT(tableName, snapshotName); - }); + return CompletableFuture.supplyAsync(() -> SYNCH_TAKESNAPSHOT(tableName, snapshotName)); } private static boolean SYNCH_TAKESNAPSHOT(String tableName, String snapshotName) { diff --git a/vendor/ctre/src/main/java/com/team2813/lib2813/vendor/ctre/motor/TalonFXWrapper.java b/vendor/ctre/src/main/java/com/team2813/lib2813/vendor/ctre/motor/TalonFXWrapper.java index 62f2cc37..879cf187 100644 --- a/vendor/ctre/src/main/java/com/team2813/lib2813/vendor/ctre/motor/TalonFXWrapper.java +++ b/vendor/ctre/src/main/java/com/team2813/lib2813/vendor/ctre/motor/TalonFXWrapper.java @@ -190,7 +190,7 @@ public TalonFX motor() { *

  • Brake: The motor stops applying an input, and actively opposes its inertia. * * - * @param mode + * @param mode the state of the motor controller bridge when output is neutral or disabled */ public void setNeutralMode(NeutralModeValue mode) { motor.setNeutralMode(mode);