diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/SwitchUtils.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/SwitchUtils.java index 653038346c10..b759773ddea5 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/SwitchUtils.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/SwitchUtils.java @@ -24,17 +24,19 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.*; + public class SwitchUtils { private SwitchUtils() {} public static int calculateBranchCount(@NotNull PsiSwitchStatement statement) { final PsiCodeBlock body = statement.getBody(); - int branches = 0; if (body == null) { - return branches; + return 0; } final PsiStatement[] statements = body.getStatements(); + int branches = 0; for (final PsiStatement child : statements) { if (child instanceof PsiSwitchLabelStatement) { branches++; @@ -266,4 +268,89 @@ public class SwitchUtils { return m_used; } } + + public static class IfStatementBranch { + + private final Set topLevelVariables = new HashSet(3); + private final LinkedList comments = new LinkedList(); + private final LinkedList statementComments = new LinkedList(); + private final List caseExpressions = new ArrayList(3); + private final PsiStatement statement; + private final boolean elseBranch; + + public IfStatementBranch(PsiStatement branch, boolean elseBranch) { + statement = branch; + this.elseBranch = elseBranch; + calculateVariablesDeclared(statement); + } + + public void addComment(String comment) { + comments.addFirst(comment); + } + + public void addStatementComment(String comment) { + statementComments.addFirst(comment); + } + + public void addCaseExpression(PsiExpression expression) { + caseExpressions.add(expression); + } + + public PsiStatement getStatement() { + return statement; + } + + public List getCaseExpressions() { + return Collections.unmodifiableList(caseExpressions); + } + + public boolean isElse() { + return elseBranch; + } + + public boolean topLevelDeclarationsConflictWith(IfStatementBranch testBranch) { + final Set topLevel = testBranch.topLevelVariables; + return intersects(topLevelVariables, topLevel); + } + + private static boolean intersects(Set set1, Set set2) { + for (final String s : set1) { + if (set2.contains(s)) { + return true; + } + } + return false; + } + + public List getComments() { + return comments; + } + + public List getStatementComments() { + return statementComments; + } + + public void calculateVariablesDeclared(PsiStatement statement) { + if (statement == null) { + return; + } + if (statement instanceof PsiDeclarationStatement) { + final PsiDeclarationStatement declarationStatement = (PsiDeclarationStatement)statement; + final PsiElement[] elements = declarationStatement.getDeclaredElements(); + for (PsiElement element : elements) { + final PsiVariable variable = (PsiVariable)element; + final String varName = variable.getName(); + topLevelVariables.add(varName); + } + } + else if (statement instanceof PsiBlockStatement) { + final PsiBlockStatement block = (PsiBlockStatement)statement; + final PsiCodeBlock codeBlock = block.getCodeBlock(); + final PsiStatement[] statements = codeBlock.getStatements(); + for (PsiStatement statement1 : statements) { + calculateVariablesDeclared(statement1); + } + } + } + } } diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/migration/IfCanBeSwitchInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/migration/IfCanBeSwitchInspection.java index 53103044ffa7..c367688e3db6 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/migration/IfCanBeSwitchInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/migration/IfCanBeSwitchInspection.java @@ -30,6 +30,7 @@ import com.siyeh.ig.psiutils.ControlFlowUtils; import com.siyeh.ig.psiutils.EquivalenceChecker; import com.siyeh.ig.psiutils.ParenthesesUtils; import com.siyeh.ig.psiutils.SwitchUtils; +import com.siyeh.ig.psiutils.SwitchUtils.IfStatementBranch; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/migration/IfStatementBranch.java b/plugins/InspectionGadgets/src/com/siyeh/ig/migration/IfStatementBranch.java deleted file mode 100644 index 2efb2a90f817..000000000000 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/migration/IfStatementBranch.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.siyeh.ig.migration; - -import com.intellij.psi.*; - -import java.util.*; - -class IfStatementBranch { - - private final Set topLevelVariables = new HashSet(3); - private final LinkedList comments = new LinkedList(); - private final LinkedList statementComments = new LinkedList(); - private final List caseExpressions = new ArrayList(3); - private final PsiStatement statement; - private final boolean elseBranch; - - public IfStatementBranch(PsiStatement branch, boolean elseBranch) { - statement = branch; - this.elseBranch = elseBranch; - calculateVariablesDeclared(statement); - } - - public void addComment(String comment) { - comments.addFirst(comment); - } - - public void addStatementComment(String comment) { - statementComments.addFirst(comment); - } - - public void addCaseExpression(PsiExpression expression) { - caseExpressions.add(expression); - } - - public PsiStatement getStatement() { - return statement; - } - - public List getCaseExpressions() { - return Collections.unmodifiableList(caseExpressions); - } - - public boolean isElse() { - return elseBranch; - } - - public boolean topLevelDeclarationsConflictWith(IfStatementBranch testBranch) { - final Set topLevel = testBranch.topLevelVariables; - return intersects(topLevelVariables, topLevel); - } - - private static boolean intersects(Set set1, Set set2) { - for (final String s : set1) { - if (set2.contains(s)) { - return true; - } - } - return false; - } - - public List getComments() { - return comments; - } - - public List getStatementComments() { - return statementComments; - } - - public void calculateVariablesDeclared(PsiStatement statement) { - if (statement == null) { - return; - } - if (statement instanceof PsiDeclarationStatement) { - final PsiDeclarationStatement declarationStatement = (PsiDeclarationStatement)statement; - final PsiElement[] elements = declarationStatement.getDeclaredElements(); - for (PsiElement element : elements) { - final PsiVariable variable = (PsiVariable)element; - final String varName = variable.getName(); - topLevelVariables.add(varName); - } - } - else if (statement instanceof PsiBlockStatement) { - final PsiBlockStatement block = (PsiBlockStatement)statement; - final PsiCodeBlock codeBlock = block.getCodeBlock(); - final PsiStatement[] statements = codeBlock.getStatements(); - for (PsiStatement statement1 : statements) { - calculateVariablesDeclared(statement1); - } - } - } -} diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/IfStatementBranch.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/IfStatementBranch.java deleted file mode 100644 index 598809d5e25a..000000000000 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/IfStatementBranch.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.siyeh.ipp.switchtoif; - -import com.intellij.psi.*; - -import java.util.*; - -class IfStatementBranch { - - private final Set topLevelVariables = new HashSet(3); - private final LinkedList comments = new LinkedList(); - private final LinkedList statementComments = new LinkedList(); - private final List caseExpressions = new ArrayList(3); - private final PsiStatement statement; - private final boolean elseBranch; - - public IfStatementBranch(PsiStatement branch, boolean elseBranch) { - statement = branch; - this.elseBranch = elseBranch; - calculateVariablesDeclared(statement); - } - - public void addComment(String comment) { - comments.addFirst(comment); - } - - public void addStatementComment(String comment) { - statementComments.addFirst(comment); - } - - public void addCaseExpression(PsiExpression expression) { - caseExpressions.add(expression); - } - - public PsiStatement getStatement() { - return statement; - } - - public List getCaseExpressions() { - return Collections.unmodifiableList(caseExpressions); - } - - public boolean isElse() { - return elseBranch; - } - - public boolean topLevelDeclarationsConflictWith(IfStatementBranch testBranch) { - final Set topLevel = testBranch.topLevelVariables; - return intersects(topLevelVariables, topLevel); - } - - private static boolean intersects(Set set1, Set set2) { - for (final String s : set1) { - if (set2.contains(s)) { - return true; - } - } - return false; - } - - public List getComments() { - return comments; - } - - public List getStatementComments() { - return statementComments; - } - - public void calculateVariablesDeclared(PsiStatement statement) { - if (statement == null) { - return; - } - if (statement instanceof PsiDeclarationStatement) { - final PsiDeclarationStatement declarationStatement = (PsiDeclarationStatement)statement; - final PsiElement[] elements = declarationStatement.getDeclaredElements(); - for (PsiElement element : elements) { - final PsiVariable variable = (PsiVariable)element; - final String varName = variable.getName(); - topLevelVariables.add(varName); - } - } - else if (statement instanceof PsiBlockStatement) { - final PsiBlockStatement block = (PsiBlockStatement)statement; - final PsiCodeBlock codeBlock = block.getCodeBlock(); - final PsiStatement[] statements = codeBlock.getStatements(); - for (PsiStatement statement1 : statements) { - calculateVariablesDeclared(statement1); - } - } - } -} diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/IfToSwitchPredicate.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/IfToSwitchPredicate.java index 7085d7800419..e7337533ce96 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/IfToSwitchPredicate.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/IfToSwitchPredicate.java @@ -19,6 +19,7 @@ import com.intellij.psi.JavaTokenType; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiIfStatement; import com.intellij.psi.PsiJavaToken; +import com.siyeh.ig.psiutils.SwitchUtils; import com.siyeh.ipp.base.PsiElementPredicate; import com.siyeh.ipp.psiutils.ErrorUtil; @@ -40,6 +41,6 @@ class IfToSwitchPredicate implements PsiElementPredicate { if (ErrorUtil.containsError(statement)) { return false; } - return SwitchUtils.getSwitchExpression(statement) != null; + return SwitchUtils.getSwitchExpression(statement, 0) != null; } } \ No newline at end of file diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/LabelSearchVisitor.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/LabelSearchVisitor.java deleted file mode 100644 index 5ab51566d190..000000000000 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/LabelSearchVisitor.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.siyeh.ipp.switchtoif; - -import com.intellij.psi.*; - -class LabelSearchVisitor extends JavaRecursiveElementWalkingVisitor { - - private final String m_labelName; - private boolean m_used = false; - - LabelSearchVisitor(String name) { - m_labelName = name; - } - - @Override - public void visitElement(PsiElement element) { - if (m_used) { - return; - } - super.visitElement(element); - } - - @Override - public void visitLabeledStatement(PsiLabeledStatement statement) { - final PsiIdentifier labelIdentifier = statement.getLabelIdentifier(); - final String labelText = labelIdentifier.getText(); - if (labelText.equals(m_labelName)) { - m_used = true; - } - } - - public boolean isUsed() { - return m_used; - } -} \ No newline at end of file diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchIntention.java index 92af4406da68..cde03e1aeb1c 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchIntention.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchIntention.java @@ -19,6 +19,8 @@ import com.intellij.psi.*; import com.intellij.psi.tree.IElementType; import com.intellij.psi.util.PsiTreeUtil; import com.siyeh.ig.psiutils.EquivalenceChecker; +import com.siyeh.ig.psiutils.SwitchUtils; +import com.siyeh.ig.psiutils.SwitchUtils.IfStatementBranch; import com.siyeh.ipp.base.Intention; import com.siyeh.ipp.base.PsiElementPredicate; import com.siyeh.ipp.psiutils.ControlFlowUtils; @@ -64,7 +66,7 @@ public class ReplaceIfWithSwitchIntention extends Intention { } } final PsiIfStatement statementToReplace = ifStatement; - final PsiExpression switchExpression = SwitchUtils.getSwitchExpression(ifStatement); + final PsiExpression switchExpression = SwitchUtils.getSwitchExpression(ifStatement, 0); if (switchExpression == null) { return; } diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/SwitchUtils.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/SwitchUtils.java deleted file mode 100644 index 06f9d98acbdd..000000000000 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/switchtoif/SwitchUtils.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright 2003-2013 Dave Griffith, Bas Leijdekkers - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.siyeh.ipp.switchtoif; - -import com.intellij.pom.java.LanguageLevel; -import com.intellij.psi.*; -import com.intellij.psi.tree.IElementType; -import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.psi.util.PsiUtil; -import com.siyeh.ig.psiutils.EquivalenceChecker; -import com.siyeh.ipp.psiutils.ParenthesesUtils; -import com.siyeh.ipp.psiutils.SideEffectChecker; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.Nullable; - -class SwitchUtils { - - private SwitchUtils() {} - - @Nullable - public static PsiExpression getSwitchExpression(PsiIfStatement statement) { - final PsiExpression condition = statement.getCondition(); - final LanguageLevel languageLevel = PsiUtil.getLanguageLevel(statement); - final PsiExpression possibleSwitchExpression = determinePossibleSwitchExpressions(condition, languageLevel); - if (!canBeSwitchExpression(possibleSwitchExpression, languageLevel)) { - return null; - } - while (true) { - if (!canBeMadeIntoCase(statement.getCondition(), possibleSwitchExpression, languageLevel)) { - break; - } - final PsiStatement elseBranch = statement.getElseBranch(); - if (!(elseBranch instanceof PsiIfStatement)) { - return possibleSwitchExpression; - } - statement = (PsiIfStatement)elseBranch; - } - return null; - } - - private static boolean canBeMadeIntoCase(PsiExpression expression, PsiExpression switchExpression, LanguageLevel languageLevel) { - expression = ParenthesesUtils.stripParentheses(expression); - if (languageLevel.isAtLeast(LanguageLevel.JDK_1_7)) { - final PsiExpression stringSwitchExpression = determinePossibleStringSwitchExpression(expression); - if (EquivalenceChecker.expressionsAreEquivalent(switchExpression, stringSwitchExpression)) { - return true; - } - } - if (!(expression instanceof PsiPolyadicExpression)) { - return false; - } - final PsiPolyadicExpression polyadicExpression = (PsiPolyadicExpression)expression; - final IElementType operation = polyadicExpression.getOperationTokenType(); - final PsiExpression[] operands = polyadicExpression.getOperands(); - if (operation.equals(JavaTokenType.OROR)) { - for (PsiExpression operand : operands) { - if (!canBeMadeIntoCase(operand, switchExpression, languageLevel)) { - return false; - } - } - return true; - } - else if (operation.equals(JavaTokenType.EQEQ) && operands.length == 2) { - return (canBeCaseLabel(operands[0], languageLevel) && EquivalenceChecker.expressionsAreEquivalent(switchExpression, operands[1])) || - (canBeCaseLabel(operands[1], languageLevel) && EquivalenceChecker.expressionsAreEquivalent(switchExpression, operands[0])); - } - else { - return false; - } - } - - private static boolean canBeSwitchExpression(PsiExpression expression, LanguageLevel languageLevel) { - if (expression == null || SideEffectChecker.mayHaveSideEffects(expression)) { - return false; - } - final PsiType type = expression.getType(); - if (PsiType.CHAR.equals(type) || PsiType.BYTE.equals(type) || PsiType.SHORT.equals(type) || PsiType.INT.equals(type)) { - return true; - } - else if (type instanceof PsiClassType) { - if (type.equalsToText(CommonClassNames.JAVA_LANG_CHARACTER) || type.equalsToText(CommonClassNames.JAVA_LANG_BYTE) || - type.equalsToText(CommonClassNames.JAVA_LANG_SHORT) || type.equalsToText(CommonClassNames.JAVA_LANG_INTEGER)) { - return true; - } - if (languageLevel.isAtLeast(LanguageLevel.JDK_1_5)) { - final PsiClassType classType = (PsiClassType)type; - final PsiClass aClass = classType.resolve(); - if (aClass != null && aClass.isEnum()) { - return true; - } - } - if (languageLevel.isAtLeast(LanguageLevel.JDK_1_7) && type.equalsToText(CommonClassNames.JAVA_LANG_STRING)) { - return true; - } - } - return false; - } - - private static PsiExpression determinePossibleSwitchExpressions(PsiExpression expression, LanguageLevel languageLevel) { - expression = ParenthesesUtils.stripParentheses(expression); - if (expression == null) { - return null; - } - if (languageLevel.isAtLeast(LanguageLevel.JDK_1_7)) { - final PsiExpression jdk17Expression = determinePossibleStringSwitchExpression(expression); - if (jdk17Expression != null) { - return jdk17Expression; - } - } - if (!(expression instanceof PsiPolyadicExpression)) { - return null; - } - final PsiPolyadicExpression polyadicExpression = (PsiPolyadicExpression)expression; - final IElementType operation = polyadicExpression.getOperationTokenType(); - final PsiExpression[] operands = polyadicExpression.getOperands(); - if (operation.equals(JavaTokenType.OROR) && operands.length > 0) { - return determinePossibleSwitchExpressions(operands[0], languageLevel); - } - else if (operation.equals(JavaTokenType.EQEQ) && operands.length == 2) { - final PsiExpression lhs = operands[0]; - final PsiExpression rhs = operands[1]; - if (canBeCaseLabel(lhs, languageLevel)) { - return rhs; - } - else if (canBeCaseLabel(rhs, languageLevel)) { - return lhs; - } - } - return null; - } - - private static PsiExpression determinePossibleStringSwitchExpression(PsiExpression expression) { - if (!(expression instanceof PsiMethodCallExpression)) { - return null; - } - final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression)expression; - final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); - @NonNls final String referenceName = methodExpression.getReferenceName(); - if (!"equals".equals(referenceName)) { - return null; - } - final PsiExpression qualifierExpression = methodExpression.getQualifierExpression(); - if (qualifierExpression == null) { - return null; - } - final PsiType type = qualifierExpression.getType(); - if (type == null || !type.equalsToText(CommonClassNames.JAVA_LANG_STRING)) { - return null; - } - final PsiExpressionList argumentList = methodCallExpression.getArgumentList(); - final PsiExpression[] arguments = argumentList.getExpressions(); - if (arguments.length != 1) { - return null; - } - final PsiExpression argument = arguments[0]; - final PsiType argumentType = argument.getType(); - if (argumentType == null || !argumentType.equalsToText(CommonClassNames.JAVA_LANG_STRING)) { - return null; - } - if (PsiUtil.isConstantExpression(qualifierExpression)) { - return argument; - } - else if (PsiUtil.isConstantExpression(argument)) { - return qualifierExpression; - } - return null; - } - - private static boolean canBeCaseLabel(PsiExpression expression, LanguageLevel languageLevel) { - if (expression == null) { - return false; - } - if (languageLevel.isAtLeast(LanguageLevel.JDK_1_5) && expression instanceof PsiReferenceExpression) { - final PsiElement referent = ((PsiReference)expression).resolve(); - if (referent instanceof PsiEnumConstant) { - return true; - } - } - final PsiType type = expression.getType(); - return (PsiType.INT.equals(type) || PsiType.SHORT.equals(type) || PsiType.BYTE.equals(type) || PsiType.CHAR.equals(type)) && - PsiUtil.isConstantExpression(expression); - } - - public static String findUniqueLabelName(PsiStatement statement, @NonNls String baseName) { - final PsiElement ancestor = PsiTreeUtil.getParentOfType(statement, PsiMember.class); - if (!checkForLabel(baseName, ancestor)) { - return baseName; - } - int val = 1; - while (true) { - final String name = baseName + val; - if (!checkForLabel(name, ancestor)) { - return name; - } - val++; - } - } - - private static boolean checkForLabel(String name, PsiElement ancestor) { - final LabelSearchVisitor visitor = new LabelSearchVisitor(name); - ancestor.accept(visitor); - return visitor.isUsed(); - } -} \ No newline at end of file diff --git a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchlIntentionTest.java b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchIntentionTest.java similarity index 94% rename from plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchlIntentionTest.java rename to plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchIntentionTest.java index f6692ab4e2c6..b1f36431ac53 100644 --- a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchlIntentionTest.java +++ b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/switchtoif/ReplaceIfWithSwitchIntentionTest.java @@ -21,7 +21,7 @@ import com.siyeh.ipp.IPPTestCase; /** * @see ReplaceIfWithSwitchIntention */ -public class ReplaceIfWithSwitchlIntentionTest extends IPPTestCase { +public class ReplaceIfWithSwitchIntentionTest extends IPPTestCase { public void testComments() { doTest(); } public void testLong() { assertIntentionNotAvailable(); }