From a89f6a271013965eb29f122feb28afd83cbeca46 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 28 Mar 2012 18:36:27 +0400 Subject: [PATCH] Fixing EA-35207 - assert: JetCompiler$CompilerProcessListener$CompilerMessage.reportTo --- .../jetbrains/jet/lang/diagnostics/DiagnosticUtils.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.java index 65c0a79dd3c..67ab02f1d5f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.java @@ -77,12 +77,12 @@ public class DiagnosticUtils { return offsetToLineAndColumn(document, offset).toString() + pathSuffix; } - @Nullable + @NotNull public static LineAndColumn getLineAndColumn(@NotNull Diagnostic diagnostic) { PsiFile file = diagnostic.getPsiFile(); Document document = file.getViewProvider().getDocument(); List textRanges = diagnostic.getTextRanges(); - if (textRanges.isEmpty()) return null; + if (textRanges.isEmpty()) return LineAndColumn.NONE; TextRange firstRange = textRanges.iterator().next(); return offsetToLineAndColumn(document, firstRange.getStartOffset()); } @@ -114,6 +114,9 @@ public class DiagnosticUtils { } public static final class LineAndColumn { + + public static final LineAndColumn NONE = new LineAndColumn(-1, -1); + private final int line; private final int column;