scannableFile = new ScannableFile(psiFile, module);
final Map<String, PsiFile> filesToScan = Collections.singletonMap(scannableFile.getAbsolutePath(), psiFile);
final boolean suppressingErrors = checkStylePlugin.getConfiguration().isSuppressingErrors();
final CheckStyleAuditListener listener = new CheckStyleAuditListener(
filesToScan, manager, false, suppressingErrors, checkerContainer.getTabWidth(), checks);
final Checker checker = checkerContainer.getChecker();
synchronized (checker) {
checker.addListener(listener);
checker.process(Arrays.asList(scannableFile.getFile()));
checker.removeListener(listener);
}
final List<ProblemDescriptor> problems = listener.getProblems(psiFile);
return problems.toArray(new ProblemDescriptor[problems.size()]);
} finally {
if (scannableFile != null) {
scannableFile.deleteIfRequired();