diff --git a/java/java-tests/testData/codeInsight/template/ElseIf-out.java b/java/java-tests/testData/codeInsight/template/ElseIf-out.java index 255ae3e80f03..f4c829177ed7 100644 --- a/java/java-tests/testData/codeInsight/template/ElseIf-out.java +++ b/java/java-tests/testData/codeInsight/template/ElseIf-out.java @@ -2,7 +2,8 @@ import java.util.*; class Foo { void test(int x){ - if(x > 0) {} else if () { + if(x > 0) {} else if () { + } } } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/template/ElseIf2-out.java b/java/java-tests/testData/codeInsight/template/ElseIf2-out.java index 9113f164ffce..08ab7eac1d00 100644 --- a/java/java-tests/testData/codeInsight/template/ElseIf2-out.java +++ b/java/java-tests/testData/codeInsight/template/ElseIf2-out.java @@ -2,7 +2,8 @@ import java.util.*; class Foo { void test(int x){ - if(x > 0) {} else if () { + if(x > 0) {} else if () { + } else {} } } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/template/ElseIf3-out.java b/java/java-tests/testData/codeInsight/template/ElseIf3-out.java index 37b0dc0ffb38..cbb818fe33a4 100644 --- a/java/java-tests/testData/codeInsight/template/ElseIf3-out.java +++ b/java/java-tests/testData/codeInsight/template/ElseIf3-out.java @@ -3,7 +3,8 @@ import java.util.*; class Foo { void test(int x){ if(x > 0) {} - else if(x == 0) {} else if () { + else if(x == 0) {} else if () { + } else {} } } \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy index 0dd31714b76d..297f4fd3c8ac 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/JavaLiveTemplateTest.groovy @@ -161,18 +161,21 @@ class Outer { void testElseIf() throws Throwable { configure() startTemplate("else-if", "Java") + WriteCommandAction.runWriteCommandAction(project) { state.gotoEnd(false) } checkResult() } void testElseIf2() throws Throwable { configure() startTemplate("else-if", "Java") + WriteCommandAction.runWriteCommandAction(project) { state.gotoEnd(false) } checkResult() } void testElseIf3() throws Throwable { configure() startTemplate("else-if", "Java") + WriteCommandAction.runWriteCommandAction(project) { state.gotoEnd(false) } checkResult() } diff --git a/resources/src/liveTemplates/Java.xml b/resources/src/liveTemplates/Java.xml index 376fa3681bc7..b03ff4e59e2e 100644 --- a/resources/src/liveTemplates/Java.xml +++ b/resources/src/liveTemplates/Java.xml @@ -7,7 +7,8 @@