mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-211430 'Replace switch with if' action generates redundant fully qualified variable type
GitOrigin-RevId: b1024143570c8fe04c1beea0f8d930e5b75a0402
This commit is contained in:
committed by
intellij-monorepo-bot
parent
be046cd63b
commit
95ce02c1c5
+4
-4
@@ -167,9 +167,10 @@ public class ConvertSwitchToIfIntention implements IntentionAction {
|
||||
parent = (PsiCodeBlock)(switchStatement.getParent());
|
||||
}
|
||||
}
|
||||
JavaCodeStyleManager javaCodeStyleManager = JavaCodeStyleManager.getInstance(project);
|
||||
if (hadSideEffects) {
|
||||
final PsiStatement declarationStatement = factory.createStatementFromText(declarationString, switchStatement);
|
||||
parent.addBefore(declarationStatement, switchStatement);
|
||||
javaCodeStyleManager.shortenClassReferences(parent.addBefore(declarationStatement, switchStatement));
|
||||
}
|
||||
final PsiStatement ifStatement = factory.createStatementFromText(ifStatementText, switchStatement);
|
||||
if (unwrapDefault) {
|
||||
@@ -189,12 +190,11 @@ public class ConvertSwitchToIfIntention implements IntentionAction {
|
||||
addedIf.delete();
|
||||
}
|
||||
else {
|
||||
JavaCodeStyleManager.getInstance(project).shortenClassReferences(addedIf);
|
||||
javaCodeStyleManager.shortenClassReferences(addedIf);
|
||||
}
|
||||
}
|
||||
else {
|
||||
JavaCodeStyleManager.getInstance(project)
|
||||
.shortenClassReferences(commentTracker.replaceAndRestoreComments(switchStatement, ifStatement));
|
||||
javaCodeStyleManager.shortenClassReferences(commentTracker.replaceAndRestoreComments(switchStatement, ifStatement));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user