From 07f30f3d3578db3e5f2bbd5b5b1469aa9757e7bb Mon Sep 17 00:00:00 2001 From: Jonathan Lovelace Date: Sat, 30 Mar 2024 14:07:26 -0400 Subject: [PATCH] Suppress questionable-name warning where generic names are actually best. --- .../src/main/java/lovelace/util/NumberComparator.java | 3 ++- .../src/main/java/lovelace/util/ThrowingBiConsumer.java | 1 + .../src/main/java/lovelace/util/ThrowingTriConsumer.java | 1 + lovelace-util/src/main/java/lovelace/util/TriConsumer.java | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lovelace-util/src/main/java/lovelace/util/NumberComparator.java b/lovelace-util/src/main/java/lovelace/util/NumberComparator.java index 881e74b8c..8d20ca201 100644 --- a/lovelace-util/src/main/java/lovelace/util/NumberComparator.java +++ b/lovelace-util/src/main/java/lovelace/util/NumberComparator.java @@ -18,7 +18,7 @@ public class NumberComparator implements Comparator, Serializable { * built-in comparison function; if not, convert both to doubles and * return the result of comparing those. */ - @SuppressWarnings("ChainOfInstanceofChecks") + @SuppressWarnings({"ChainOfInstanceofChecks", "QuestionableName"}) public static int compareNumbers(final Number one, final Number two) { if ((one instanceof Integer || one instanceof Long) && (two instanceof Integer || two instanceof Long)) { @@ -40,6 +40,7 @@ public static int compareNumbers(final Number one, final Number two) { * built-in comparison function; if not, convert both to doubles and * return the result of comparing those. */ + @SuppressWarnings("QuestionableName") @Override public final int compare(final Number one, final Number two) { return compareNumbers(one, two); diff --git a/lovelace-util/src/main/java/lovelace/util/ThrowingBiConsumer.java b/lovelace-util/src/main/java/lovelace/util/ThrowingBiConsumer.java index 4d3c2cd92..e767df3a3 100644 --- a/lovelace-util/src/main/java/lovelace/util/ThrowingBiConsumer.java +++ b/lovelace-util/src/main/java/lovelace/util/ThrowingBiConsumer.java @@ -2,6 +2,7 @@ @FunctionalInterface public interface ThrowingBiConsumer { + @SuppressWarnings("QuestionableName") void accept(One one, Two two) throws Except; } diff --git a/lovelace-util/src/main/java/lovelace/util/ThrowingTriConsumer.java b/lovelace-util/src/main/java/lovelace/util/ThrowingTriConsumer.java index 9d65ea683..04ce3c26b 100644 --- a/lovelace-util/src/main/java/lovelace/util/ThrowingTriConsumer.java +++ b/lovelace-util/src/main/java/lovelace/util/ThrowingTriConsumer.java @@ -2,6 +2,7 @@ @FunctionalInterface public interface ThrowingTriConsumer { + @SuppressWarnings("QuestionableName") void accept(One one, Two two, Three three) throws Except; } diff --git a/lovelace-util/src/main/java/lovelace/util/TriConsumer.java b/lovelace-util/src/main/java/lovelace/util/TriConsumer.java index 8710d8b15..06dac0dfb 100644 --- a/lovelace-util/src/main/java/lovelace/util/TriConsumer.java +++ b/lovelace-util/src/main/java/lovelace/util/TriConsumer.java @@ -2,5 +2,6 @@ @FunctionalInterface public interface TriConsumer { + @SuppressWarnings("QuestionableName") void accept(One one, Two two, Three three); }