Skip to content

Commit

Permalink
[JENKINS-42613] Cppcheck publisher has no access to source files (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
il--ya authored May 20, 2022
1 parent 86581fb commit 8ff3c06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,7 @@ private void buildFileContent() {
if (tempFile.exists()) {
is = new FileInputStream(tempFile);
} else {
// Reading real workspace file is more incorrect than correct,
// but the code is left here for backward compatibility with
// plugin version 1.14 and less
if (cppcheckWorkspaceFile.getFileName() == null) {
throw new IOException("The file doesn't exist.");
}

File file = new File(cppcheckWorkspaceFile.getFileName());
if (!file.exists()) {
throw new IOException("Can't access the file: " + file.toURI());
}
is = new FileInputStream(file);
throw new IOException("File doesn't exist: " + tempFile.getAbsoluteFile());
}

splitSourceFile(highlightSource(is));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public final String getFileName() {

public String getTempName(final Run<?, ?> owner) {
if (fileName != null) {
return owner.getParent().getRootDir().getAbsolutePath() + "/"
return owner.getRootDir().getAbsolutePath() + "/"
+ DIR_WORKSPACE_FILES + "/"
+ Integer.toHexString(fileName.hashCode()) + ".tmp";
}
Expand Down

0 comments on commit 8ff3c06

Please sign in to comment.