early diagnostics for EA-21418

This commit is contained in:
peter.gromov
2010-11-12 17:19:30 +03:00
parent 631d8ef09e
commit b613963c92
@@ -242,8 +242,11 @@ public class PsiElementFactoryImpl extends PsiJavaParserFacadeImpl implements Ps
throw new IncorrectOperationException("Cannot create field with type \"<null_type>\".");
}
final FileElement treeHolder = DummyHolderFactory.createHolder(myManager, null).getTreeElement();
final CompositeElement treeElement =
getJavaParsingContext(treeHolder).getDeclarationParsing().parseParameterText(type.getCanonicalText() + " " + name);
final String text = type.getCanonicalText() + " " + name;
final CompositeElement treeElement = getJavaParsingContext(treeHolder).getDeclarationParsing().parseParameterText(text);
if (treeElement == null) {
throw new AssertionError("Null element for text = " + text);
}
treeHolder.rawAddChildren(treeElement);
CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(myManager.getProject());