From 83835aeff461e0125917dcc36b033074ca3fdc14 Mon Sep 17 00:00:00 2001 From: Alexey Gopachenko Date: Tue, 10 Nov 2009 15:36:10 +0300 Subject: [PATCH] Inspections - avoid IOOBE on bad range --- .../com/intellij/codeInspection/ui/ProblemDescriptionNode.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/ProblemDescriptionNode.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/ProblemDescriptionNode.java index 5a9dc80eedba..5c19584f6b3c 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/ProblemDescriptionNode.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/ProblemDescriptionNode.java @@ -132,7 +132,8 @@ public class ProblemDescriptionNode extends InspectionTreeNode { final TextRange elementRange = psiElement.getTextRange(); if (textRange!=null && elementRange!=null) { textRange = textRange.shiftRight(-elementRange.getStartOffset()); - ref = textRange.substring(ref); + if(textRange.getStartOffset() < 0 && textRange.getEndOffset()