restore intention place; fix tests

This commit is contained in:
anna
2012-07-18 17:31:32 +02:00
parent 28230348a2
commit 673cc81da2
5 changed files with 6 additions and 5 deletions

View File

@@ -39,6 +39,7 @@ public class PushConditionInCallAction extends PsiElementBaseIntentionAction {
if (element instanceof PsiCompiledElement) return false;
if (!element.getManager().isInProject(element)) return false;
if (!(element instanceof PsiJavaToken && ((PsiJavaToken)element).getTokenType() == JavaTokenType.QUEST)) return false;
final PsiConditionalExpression conditionalExpression = PsiTreeUtil.getParentOfType(element, PsiConditionalExpression.class);
if (conditionalExpression == null) return false;
final PsiExpression thenExpression = conditionalExpression.getThenExpression();
@@ -74,7 +75,7 @@ public class PushConditionInCallAction extends PsiElementBaseIntentionAction {
}
}
}
setText("Push condition '" + conditionalExpression.getCondition().getText() + "' inside " +
setText("Push condition '" + conditionalExpression.getCondition().getText() + "' inside " +
(thenMethod.isConstructor() ? "constructor" : "method") + " call");
return true;
}

View File

@@ -1,4 +1,4 @@
// "Push condition b inside method call" "true"
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = foo(b ? "true" : "false");

View File

@@ -1,4 +1,4 @@
// "Push condition b inside method call" "true"
// "Push condition 'b' inside method call" "true"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true") : foo("false");

View File

@@ -1,4 +1,4 @@
// "Push condition b inside method call" "false"
// "Push condition 'b' inside method call" "false"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true") : foo(false);

View File

@@ -1,4 +1,4 @@
// "Push condition b inside method call" "false"
// "Push condition 'b' inside method call" "false"
class Foo {
void bar(boolean b){
String s = b <caret>? foo("true", true) : foo("false", false);