diff --git a/src/main/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParser.java b/src/main/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParser.java index f0ab5f528..bbea9bcbe 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParser.java @@ -23,7 +23,7 @@ public class Gcc4CompilerParser extends LookaheadParser { private static final long serialVersionUID = 5490211629355204910L; private static final String GCC_WARNING_PATTERN = - ANT_TASK + "(.+?):(\\d+):(?:(\\d+):)? ?([wW]arning|.*[Ee]rror): (.*)$"; + "(?!\\[javac\\])" + ANT_TASK + "(.+?):(\\d+):(?:(\\d+):)? ?([wW]arning|.*[Ee]rror): (.*)$"; private static final Pattern CLASS_PATTERN = Pattern.compile("\\[-W(.+)]$"); /** diff --git a/src/test/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParserTest.java b/src/test/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParserTest.java index c2e69db8b..e86855295 100644 --- a/src/test/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParserTest.java +++ b/src/test/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParserTest.java @@ -619,4 +619,16 @@ void issue55221() { .hasSeverity(Severity.WARNING_NORMAL); } } + + /** + * Parses a javac warning log + * + * @see Issue 68396 + */ + @Test + void issue68396() { + var warnings = parse("issue68396.txt"); + + assertThat(warnings).isEmpty(); + } } diff --git a/src/test/resources/edu/hm/hafner/analysis/parser/issue68396.txt b/src/test/resources/edu/hm/hafner/analysis/parser/issue68396.txt new file mode 100644 index 000000000..fc4d136c8 --- /dev/null +++ b/src/test/resources/edu/hm/hafner/analysis/parser/issue68396.txt @@ -0,0 +1,36 @@ +[javac] import sun.misc.Signal; +[javac] ^ +[javac] import sun.misc.SignalHandler; +[javac] ^ +[javac] public class ShutdownSignalHandler implements SignalHandler { +[javac] ^ +[javac] private SignalHandler oldHandler = null; +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:62: warning: Signal is internal proprietary API and may be removed in a future release +[javac] Signal sigTerm = new Signal(SIGTERM); +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:62: warning: Signal is internal proprietary API and may be removed in a future release +[javac] Signal sigTerm = new Signal(SIGTERM); +[javac] ^ +[javac] termInstance.oldHandler = Signal.handle(sigTerm, termInstance); +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:70: warning: Signal is internal proprietary API and may be removed in a future release +[javac] Signal sigInt = new Signal(SIGINT); +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:70: warning: Signal is internal proprietary API and may be removed in a future release +[javac] Signal sigInt = new Signal(SIGINT); +[javac] ^ +[javac] intInstance.oldHandler = Signal.handle(sigInt, intInstance); +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:78: warning: Signal is internal proprietary API and may be removed in a future release +[javac] Signal sigHup = new Signal(SIGHUP); +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:78: warning: Signal is internal proprietary API and may be removed in a future release +[javac] Signal sigHup = new Signal(SIGHUP); +[javac] ^ +[javac] hupInstance.oldHandler = Signal.handle(sigHup, hupInstance); +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:88: warning: Signal is internal proprietary API and may be removed in a future release +[javac] public void handle(Signal signal) { +[javac] ^ +[javac] /jenkins/jenkins/workspaces/Active_Dev_Integration_20-3/134/sw/syssw/smc/java/NodeHealthCalculations/src/gov/nasa/lcs/smc/nodehealthcalculations/ShutdownSignalHandler.java:100: warning: SignalHandler is internal proprietary API and may be removed in a future release \ No newline at end of file