From 106accdcf5da8c92bfe26906e03a39ca55c37fbc Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 28 Jul 2019 15:57:28 -0700 Subject: [PATCH] FindBugs false positive suppression. --- .../java/net/thauvin/erik/mobibot/modules/ModuleException.java | 2 ++ src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java b/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java index 88f5af3..5c516ea 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/ModuleException.java @@ -32,6 +32,7 @@ package net.thauvin.erik.mobibot.modules; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import okhttp3.HttpUrl; import java.util.regex.Matcher; @@ -97,6 +98,7 @@ public class ModuleException extends Exception { * * @return The sanitized message. */ + @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "false positive?") String getSanitizedMessage() { if (hasCause()) { final String causeMessage = getCause().getMessage(); diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java b/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java index 2053d88..41c5cce 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/StockQuote.java @@ -32,6 +32,7 @@ package net.thauvin.erik.mobibot.modules; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import net.thauvin.erik.mobibot.Mobibot; import net.thauvin.erik.mobibot.Utils; import net.thauvin.erik.mobibot.msg.ErrorMessage; @@ -82,6 +83,7 @@ public final class StockQuote extends ThreadedModule { * @return The {@link Message} array containing the stock quote. * @throws ModuleException If an errors occurs. */ + @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "false positive?") static List getQuote(final String symbol, final String apiKey) throws ModuleException { if (!Utils.isValidString(apiKey)) { throw new ModuleException(Utils.capitalize(STOCK_CMD) + " is disabled. The API key is missing.");