From 92811808eb8ff8f8f894b3ea952c9af404c12278 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sat, 13 Apr 2024 15:06:10 +0200 Subject: [PATCH] Suppress some old warnings. --- .../java/edu/hm/hafner/analysis/parser/DrMemoryParser.java | 3 ++- src/main/java/edu/hm/hafner/analysis/parser/MentorParser.java | 2 ++ src/main/java/edu/hm/hafner/analysis/parser/RevApiParser.java | 2 ++ .../java/edu/hm/hafner/analysis/parser/XlcCompilerParser.java | 2 ++ .../java/edu/hm/hafner/analysis/parser/XlcLinkerParser.java | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java b/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java index c3b3500c3..227ed5e08 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/DrMemoryParser.java @@ -13,6 +13,7 @@ import edu.hm.hafner.analysis.ParsingException; import edu.hm.hafner.analysis.Severity; import edu.hm.hafner.util.LookaheadStream; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import static edu.hm.hafner.analysis.util.IntegerParser.*; @@ -40,7 +41,7 @@ public DrMemoryParser() { super(DR_MEMORY_WARNING_PATTERN); } - @Override + @Override @SuppressFBWarnings(value = "POTENTIAL_XML_INJECTION", justification = "Message is cleaned in UI") protected Optional createIssue(final Matcher matcher, final LookaheadStream lookahead, final IssueBuilder builder) throws ParsingException { diff --git a/src/main/java/edu/hm/hafner/analysis/parser/MentorParser.java b/src/main/java/edu/hm/hafner/analysis/parser/MentorParser.java index 7c8a7b846..c730f53f1 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/MentorParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/MentorParser.java @@ -8,6 +8,7 @@ import edu.hm.hafner.analysis.IssueBuilder; import edu.hm.hafner.analysis.LookaheadParser; import edu.hm.hafner.util.LookaheadStream; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Parser for Mentor Graphics Modelsim/Questa Simulator. @@ -125,6 +126,7 @@ private void parseVsimMessage(final LookaheadStream lookahead, final IssueBuilde builder.setMessage(parsedMessage); } + @SuppressFBWarnings(value = "POTENTIAL_XML_INJECTION", justification = "Message is cleaned in UI") private String parseSimTime(final LookaheadStream lookahead, final IssueBuilder builder) { StringBuilder description = new StringBuilder(); String timeLine = ""; diff --git a/src/main/java/edu/hm/hafner/analysis/parser/RevApiParser.java b/src/main/java/edu/hm/hafner/analysis/parser/RevApiParser.java index e30d25366..f58e3e4f4 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/RevApiParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/RevApiParser.java @@ -14,6 +14,7 @@ import edu.hm.hafner.analysis.Report; import edu.hm.hafner.analysis.RevApiInfoExtension; import edu.hm.hafner.analysis.Severity; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Parser for Revapi reports. @@ -102,6 +103,7 @@ private Severity toSeverity(final String level) { } } + @SuppressFBWarnings(value = "POTENTIAL_XML_INJECTION", justification = "Message is cleaned in UI") private String getDescription(final JSONObject jsonIssue) { StringBuilder severityDescription = new StringBuilder(CAPACITY); for (Object severity : jsonIssue.getJSONArray("classification")) { diff --git a/src/main/java/edu/hm/hafner/analysis/parser/XlcCompilerParser.java b/src/main/java/edu/hm/hafner/analysis/parser/XlcCompilerParser.java index a9a0f78aa..4e561677e 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/XlcCompilerParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/XlcCompilerParser.java @@ -9,12 +9,14 @@ import edu.hm.hafner.analysis.LookaheadParser; import edu.hm.hafner.analysis.Severity; import edu.hm.hafner.util.LookaheadStream; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * A parser for IBM xlC compiler warnings. * * @author Andrew Gvozdev */ +@SuppressFBWarnings("REDOS") public class XlcCompilerParser extends LookaheadParser { private static final long serialVersionUID = 5490211629355204910L; diff --git a/src/main/java/edu/hm/hafner/analysis/parser/XlcLinkerParser.java b/src/main/java/edu/hm/hafner/analysis/parser/XlcLinkerParser.java index 19fc154ec..5462875b6 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/XlcLinkerParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/XlcLinkerParser.java @@ -9,12 +9,14 @@ import edu.hm.hafner.analysis.LookaheadParser; import edu.hm.hafner.analysis.Severity; import edu.hm.hafner.util.LookaheadStream; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * A parser for IBM xlC linker warnings. * * @author Andrew Gvozdev */ +@SuppressFBWarnings("REDOS") public class XlcLinkerParser extends LookaheadParser { private static final long serialVersionUID = 211259620936831096L; private static final String XLC_LINKER_WARNING_PATTERN = ANT_TASK + "ld: ([0-9]+-[0-9]+)*\\s*(.*)$";