fix broken code for creation of variable declaration

This commit is contained in:
Maxim.Mossienko
2013-04-22 09:54:48 +02:00
parent b9ed8758ad
commit 98536353a6
@@ -580,7 +580,7 @@ public class PsiElementFactoryImpl extends PsiJavaParserFacadeImpl implements Ps
throw new IncorrectOperationException("Cannot create variable with type \"null\".");
}
final String text = "X " + (initializer != null ? " = x" : "") + " = x";
final String text = "X " + name + (initializer != null ? " = x" : "") + ";";
final PsiDeclarationStatement statement = (PsiDeclarationStatement)createStatementFromText(text, null);
final PsiVariable variable = (PsiVariable)statement.getDeclaredElements()[0];