CR-IC-41 Vertical line block match disapear view line in java code (IDEA-99572)

NPE was reported for the expression 'myComments.put(language, comments = LanguageParserDefinitions.INSTANCE.forLanguage(language).getCommentTokens());
This commit is contained in:
Denis.Zhdanov
2013-02-27 10:44:17 +04:00
parent 018d30e153
commit acb83c2b3b
@@ -545,7 +545,16 @@ public class IndentsPass extends TextEditorHighlightingPass implements DumbAware
Language language = tokenType.getLanguage();
TokenSet comments = myComments.get(language);
if (comments == null) {
myComments.put(language, comments = LanguageParserDefinitions.INSTANCE.forLanguage(language).getCommentTokens());
ParserDefinition definition = LanguageParserDefinitions.INSTANCE.forLanguage(language);
if (definition != null) {
comments = definition.getCommentTokens();
}
if (comments == null) {
return fallbackColumn;
}
else {
myComments.put(language, comments);
}
}
if (comments.contains(tokenType) && indentOffset == it.getStart()) {
String prefix = COMMENT_PREFIXES.get(tokenType);