1313import com .intellij .openapi .vfs .VirtualFile ;
1414import com .intellij .openapi .wm .StatusBar ;
1515import com .intellij .psi .PsiFile ;
16+ import org .apache .commons .lang3 .RandomStringUtils ;
1617import org .jetbrains .annotations .NotNull ;
1718import org .jetbrains .annotations .Nullable ;
1819import org .xml .sax .SAXException ;
@@ -29,7 +30,7 @@ public ProblemDescriptor[] checkFile(@NotNull PsiFile file,
2930 @ NotNull InspectionManager manager ,
3031 boolean isOnTheFly ) {
3132 final VirtualFile vFile = file .getVirtualFile ();
32- if (vFile == null || !isCFamilyFile (vFile )) {
33+ if (vFile == null || !vFile . isInLocalFileSystem () || ! isCFamilyFile (vFile )) {
3334 return ProblemDescriptor .EMPTY_ARRAY ;
3435 }
3536
@@ -55,7 +56,7 @@ public ProblemDescriptor[] checkFile(@NotNull PsiFile file,
5556
5657 File tempFile = null ;
5758 try {
58- tempFile = FileUtil .createTempFile (" " , vFile .getName (), true );
59+ tempFile = FileUtil .createTempFile (RandomStringUtils . randomAlphanumeric ( 8 ) + "_ " , vFile .getName (), true );
5960 FileUtil .writeToFile (tempFile , document .getText ());
6061 final String cppcheckOutput =
6162 CppCheckInspectionImpl .executeCommandOnFile (cppcheckPath , prependIncludeDir (cppcheckOptions , vFile ),
0 commit comments