|
39 | 39 | import com.intellij.psi.stubs.StubIndex; |
40 | 40 | import com.intellij.psi.util.PsiTreeUtil; |
41 | 41 | import com.intellij.util.Function; |
42 | | -import com.intellij.util.ObjectUtils; |
43 | 42 | import com.intellij.util.containers.ContainerUtil; |
44 | 43 | import com.intellij.xml.util.XmlStringUtil; |
45 | 44 | import org.jetbrains.annotations.NotNull; |
46 | 45 | import org.jetbrains.annotations.Nullable; |
47 | 46 |
|
48 | | -import java.util.*; |
| 47 | +import java.util.Arrays; |
| 48 | +import java.util.Collections; |
| 49 | +import java.util.Comparator; |
| 50 | +import java.util.List; |
49 | 51 |
|
50 | 52 | public class GoDocumentationProvider extends AbstractDocumentationProvider { |
51 | 53 | private static final GoCommentsConverter COMMENTS_CONVERTER = new GoCommentsConverter(); |
@@ -277,7 +279,7 @@ private static String replaceInnerTypes(@NotNull GoType type, @Nullable String c |
277 | 279 | private static String replaceInnerTypes(@NotNull GoType type, @Nullable String contextImportPath, @NotNull List<GoType> innerTypes) { |
278 | 280 | StringBuilder result = new StringBuilder(); |
279 | 281 | String typeText = type.getText(); |
280 | | - int initialOffset = ObjectUtils.notNull(type.getTextRange(), TextRange.EMPTY_RANGE).getStartOffset(); |
| 282 | + int initialOffset = type.getTextRange().getStartOffset(); // todo[zolotov] a potential NPE: type.getTextRange() could be null |
281 | 283 | int lastStartOffset = type.getTextLength(); |
282 | 284 | ContainerUtil.sort(innerTypes, ELEMENT_BY_RANGE_COMPARATOR); |
283 | 285 | for (int i = innerTypes.size() - 1; i >= 0; i--) { |
|
0 commit comments