Skip to content

Commit

Permalink
CxxPreprocessor: fix handling of SquidAstVisitorContext (2)
Browse files Browse the repository at this point in the history
* remove wrong is-null checks (although I hope, that SonarOpenCommunity#1638 will
  be merged and we could remove the code completely)
  • Loading branch information
ivangalkin authored and Bertk committed Jun 22, 2019
1 parent 0627f69 commit 9697f40
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ PreprocessorAction handleIncludeLine(AstNode ast, Token token, String filename,
File includedFile = findIncludedFile(ast, token, filename);

File currentFile = this.getFileUnderAnalysis();
if (currentFile != null && includedFile != null) {
if (includedFile != null) {
includedFiles.put(currentFile.getPath(), new Include(token.getLine(), includedFile.getAbsolutePath()));
}

Expand All @@ -1087,9 +1087,7 @@ PreprocessorAction handleIncludeLine(AstNode ast, Token token, String filename,
if (LOG.isDebugEnabled()) {
LOG.debug("[" + filename + ":" + token.getLine() + "]: cannot find include file '" + token.getValue() + "'");
}
if (currentFile != null) {
missingIncludeFiles.put(currentFile.getPath(), new Include(token.getLine(), token.getValue()));
}
missingIncludeFiles.put(currentFile.getPath(), new Include(token.getLine(), token.getValue()));
} else if (analysedFiles.add(includedFile.getAbsoluteFile())) {
if (LOG.isTraceEnabled()) {
LOG.trace("[{}:{}]: processing {}, resolved to file '{}'",
Expand Down

0 comments on commit 9697f40

Please sign in to comment.