mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
disable wrap with fixes in switch cases where only constants are accepted (IDEA-196151)
This commit is contained in:
@@ -105,6 +105,7 @@ public class WrapExpressionFix implements IntentionAction {
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
return myExpression.isValid()
|
||||
&& myExpression.getManager().isInProject(myExpression)
|
||||
&& !(myExpression.getParent() instanceof PsiSwitchLabelStatement)
|
||||
&& myExpectedType != null
|
||||
&& myExpectedType.isValid()
|
||||
&& myExpression.getType() != null
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Wrap using 'String.valueOf()'" "false"
|
||||
public class Test {
|
||||
void foo(String i) {
|
||||
switch (i) {
|
||||
case '<caret>0':
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ import com.intellij.pom.java.LanguageLevel;
|
||||
|
||||
public class WrapExpressionFixTest extends LightQuickFixParameterizedTestCase {
|
||||
@Override
|
||||
protected LanguageLevel getLanguageLevel() {
|
||||
protected LanguageLevel getDefaultLanguageLevel() {
|
||||
return LanguageLevel.JDK_1_6;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user