Skip to content

Commit

Permalink
Make CPPCheck opening regex more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
bracketttc committed May 16, 2020
1 parent 27c0fe5 commit aef04ec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CPPCheckParser implements ViolationsParser {
@Override
public List<Violation> parseReportOutput(final String string) throws Exception {
final List<Violation> violations = new ArrayList<>();
final List<String> errorChunks = getChunks(string, "<error", "</error>");
final List<String> errorChunks = getChunks(string, "<error ", "</error>");
for (int errorIndex = 0; errorIndex < errorChunks.size(); errorIndex++) {
final String errorChunk = errorChunks.get(errorIndex);
final String severity = getAttribute(errorChunk, "severity");
Expand Down Expand Up @@ -49,7 +49,7 @@ public List<Violation> parseReportOutput(final String string) throws Exception {
}
}

final List<String> errorChunksNoEndtag = getChunks(string, "<error", "\\/>");
final List<String> errorChunksNoEndtag = getChunks(string, "<error ", "\\/>");
for (int errorIndex = 0; errorIndex < errorChunksNoEndtag.size(); errorIndex++) {
final String errorChunk = errorChunksNoEndtag.get(errorIndex);
final String severity = getAttribute(errorChunk, "severity");
Expand Down

0 comments on commit aef04ec

Please sign in to comment.