Skip to content

Commit

Permalink
[GCC Parser] Skip log lines that are from javac (#1129)
Browse files Browse the repository at this point in the history
Ignore all gcc-warnings that are prefixed by `[javac]`.
  • Loading branch information
Jay-oao authored Jan 9, 2025
1 parent 27dd356 commit 2391382
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Gcc4CompilerParser() {

@Override
protected boolean isLineInteresting(final String line) {
return line.contains("arning") || line.contains("rror");
return (line.contains("arning") || line.contains("rror")) && !line.contains("[javac]");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,4 +619,16 @@ void issue55221() {
.hasSeverity(Severity.WARNING_NORMAL);
}
}

/**
* Parses a javac warning log.
*
* @see <a href="https://issues.jenkins.io/browse/JENKINS-68396">Issue 68396</a>
*/
@Test
void issue68396() {
var warnings = parse("issue68396.txt");

assertThat(warnings).isEmpty();
}
}
36 changes: 36 additions & 0 deletions src/test/resources/edu/hm/hafner/analysis/parser/issue68396.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2391382

Please sign in to comment.