if (project == null) {
LOG.error("Could not get project for check-in panel, skipping");
return ReturnResult.COMMIT;
}
final CheckStylePlugin plugin = project.getComponent(CheckStylePlugin.class);
if (plugin == null) {
LOG.error("Could not get CheckStyle Plug-in, skipping");
return ReturnResult.COMMIT;
}
if (plugin.getConfiguration().isScanFilesBeforeCheckin()) {
try {
final Map<PsiFile, List<ProblemDescriptor>> scanResults = new HashMap<PsiFile, List<ProblemDescriptor>>();
new Task.Modal(project, getResource("handler.before.checkin.scan.text", "CheckStyle is Scanning"), false) {
public void run(@NotNull final ProgressIndicator progressIndicator) {
progressIndicator.setText(getResource("handler.before.checkin.scan.in-progress", "Scanning..."));
progressIndicator.setIndeterminate(true);
plugin.scanFiles(new ArrayList<VirtualFile>(checkinPanel.getVirtualFiles()), scanResults);
}
}.queue();
if (!scanResults.isEmpty()) {
return processScanResults(scanResults, executor, plugin);