boolean (CompileContext context, Map<ProblemDescriptor, HighlightDisplayLevel> problemsMap) { if (problemsMap.isEmpty()) { return false; } boolean errorsReported = false; for (Map.Entry<ProblemDescriptor, HighlightDisplayLevel> entry : problemsMap.entrySet()) { ProblemDescriptor problemDescriptor = entry.getKey(); PsiElement element = problemDescriptor.getPsiElement(); PsiFile psiFile = element.getContainingFile(); if (psiFile == null) continue; VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile == null) continue; CompilerMessageCategory category = myValidator.getCategoryByHighlightDisplayLevel(entry.getValue(), virtualFile, context); Document document = myPsiDocumentManager.getDocument(psiFile); int offset = problemDescriptor.getStartElement().getTextOffset(); assert document != null; int line = document.getLineNumber(offset); int column = offset - document.getLineStartOffset(line); context.addMessage(category, problemDescriptor.getDescriptionTemplate(), virtualFile.getUrl(), line + 1, column + 1); if (CompilerMessageCategory.ERROR == category) { errorsReported = true; } } return errorsReported; }