From a7d840c0943dbc9ad3b5295959354f9e4c46f3f1 Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Fri, 25 Mar 2011 16:02:55 +0300 Subject: [PATCH] Unwrap/remove action should not show implicit 'while' statement in JSP file. --- .../com/intellij/codeInsight/unwrap/JavaWhileUnwrapper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaWhileUnwrapper.java b/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaWhileUnwrapper.java index 3910887fb119..4a2b3635c75d 100644 --- a/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaWhileUnwrapper.java +++ b/java/java-impl/src/com/intellij/codeInsight/unwrap/JavaWhileUnwrapper.java @@ -17,6 +17,7 @@ package com.intellij.codeInsight.unwrap; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.psi.*; +import com.intellij.psi.impl.source.tree.java.PsiWhileStatementImpl; import com.intellij.util.IncorrectOperationException; public class JavaWhileUnwrapper extends JavaUnwrapper { @@ -25,7 +26,9 @@ public class JavaWhileUnwrapper extends JavaUnwrapper { } public boolean isApplicableTo(PsiElement e) { - return e instanceof PsiWhileStatement || e instanceof PsiDoWhileStatement; + return e instanceof PsiWhileStatementImpl // Don't use "e instanceof PsiWhileStatement" because JspWhileStatement intanceof PsiWhileStatement, + // but we doesn't support unwrap JspWhileStatement. + || e instanceof PsiDoWhileStatement; } @Override