mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
[java-inspections] RedundantCastInspection: recheck that the cast is redundant in fix
This might be important if 'fix all' is applied and two casts are redundant individually, but not together GitOrigin-RevId: 90e26e9e1a04a88ef50bb87e2f981c4ee1c154f1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ec528f9f08
commit
ddc812cd28
@@ -125,7 +125,7 @@ public final class RedundantCastInspection extends AbstractBaseJavaLocalInspecti
|
||||
|
||||
@Override
|
||||
protected void applyFix(@NotNull Project project, @NotNull PsiElement castTypeElement, @NotNull ModPsiUpdater updater) {
|
||||
if (castTypeElement.getParent() instanceof PsiTypeCastExpression cast) {
|
||||
if (castTypeElement.getParent() instanceof PsiTypeCastExpression cast && RedundantCastUtil.isCastRedundant(cast)) {
|
||||
RemoveRedundantCastUtil.removeCast(cast);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user