From 09642866d455558aff06b501f98c2edce249c5ed Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Mon, 14 Feb 2011 13:01:27 +0300 Subject: [PATCH] fixed PY-2914: RE at com.jetbrains.python.psi.impl.PyBaseElementImpl.childToPsiNotNull --- .../intentions/PyDictConstructorToLiteralFormIntention.java | 4 ++-- .../intentions/PyDictLiteralFormToConstructorIntention.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/src/com/jetbrains/python/codeInsight/intentions/PyDictConstructorToLiteralFormIntention.java b/python/src/com/jetbrains/python/codeInsight/intentions/PyDictConstructorToLiteralFormIntention.java index 61bdc7e032eb..c3b119287730 100644 --- a/python/src/com/jetbrains/python/codeInsight/intentions/PyDictConstructorToLiteralFormIntention.java +++ b/python/src/com/jetbrains/python/codeInsight/intentions/PyDictConstructorToLiteralFormIntention.java @@ -81,8 +81,8 @@ public class PyDictConstructorToLiteralFormIntention extends BaseIntentionAction } } - PyExpressionStatement dict = elementGenerator.createFromText(LanguageLevel.forElement(expression), PyExpressionStatement.class, - "{" + stringBuilder.toString() + "}"); + PyDictLiteralExpression dict = (PyDictLiteralExpression)elementGenerator.createFromText(LanguageLevel.forElement(expression), PyExpressionStatement.class, + "{" + stringBuilder.toString() + "}").getExpression(); expression.replace(dict); } } diff --git a/python/src/com/jetbrains/python/codeInsight/intentions/PyDictLiteralFormToConstructorIntention.java b/python/src/com/jetbrains/python/codeInsight/intentions/PyDictLiteralFormToConstructorIntention.java index b4363939cc42..e32388fc47c2 100644 --- a/python/src/com/jetbrains/python/codeInsight/intentions/PyDictLiteralFormToConstructorIntention.java +++ b/python/src/com/jetbrains/python/codeInsight/intentions/PyDictLiteralFormToConstructorIntention.java @@ -126,8 +126,8 @@ public class PyDictLiteralFormToConstructorIntention extends BaseIntentionAction } } stringBuilder.append(")"); - PyStatement callExpression = elementGenerator.createFromText(LanguageLevel.forElement(dictExpression), - PyStatement.class, stringBuilder.toString()); + PyCallExpression callExpression = (PyCallExpression)elementGenerator.createFromText(LanguageLevel.forElement(dictExpression), + PyExpressionStatement.class, stringBuilder.toString()).getExpression(); dictExpression.replace(callExpression); } }