Skip to content

Commit

Permalink
Fix GCC Parsing Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay-oao committed Jan 8, 2025
1 parent 0c2a702 commit daa103c
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 @@ -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(.+)]$");

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

/**

Check warning on line 623 in src/test/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParserTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

checkstyle:check

NORMAL: (javadoc) JavadocStyle: First sentence should end with a period.

Check warning on line 623 in src/test/java/edu/hm/hafner/analysis/parser/Gcc4CompilerParserTest.java

View check run for this annotation

ci.jenkins.io / CheckStyle

JavadocStyleCheck

NORMAL: First sentence should end with a period.
Raw output
<p>Since Checkstyle 3.2</p><p> Validates Javadoc comments to help ensure they are well formed. The following checks are performed: </p><ul><li> Ensures the first sentence ends with proper punctuation (That is a period, question mark, or exclamation mark, by default). Javadoc automatically places the first sentence in the method summary table and index. Without proper punctuation the Javadoc may be malformed. All items eligible for the <code>{@inheritDoc}</code> tag are exempt from this requirement. </li><li> Check text for Javadoc statements that do not have any description. This includes both completely empty Javadoc, and Javadoc with only tags such as @param and @return. </li><li> Check text for incomplete HTML tags. Verifies that HTML tags have corresponding end tags and issues an "Unclosed HTML tag found:" error if not. An "Extra HTML tag found:" error is issued if an end tag is found without a previous open tag. </li><li> Check that a package Javadoc comment is well-formed (as described above) and NOT missing from any package-info.java files. </li><li> Check for allowed HTML tags. The list of allowed HTML tags is "a", "abbr", "acronym", "address", "area", "b", "bdo", "big", "blockquote", "br", "caption", "cite", "code", "colgroup", "dd", "del", "div", "dfn", "dl", "dt", "em", "fieldset", "font", "h1" to "h6", "hr", "i", "img", "ins", "kbd", "li", "ol", "p", "pre", "q", "samp", "small", "span", "strong", "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thread", "tr", "tt", "u", "ul". </li></ul><p> These checks were patterned after the checks made by the <a href="http://maven-doccheck.sourceforge.net/">DocCheck</a> doclet available from Sun. Note: Original Sun's DocCheck tool does not exist anymore. </p>
* 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 daa103c

Please sign in to comment.