mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java redundant cast: cleanup: simplify warning registering
GitOrigin-RevId: c04868bf236d1750cec6cc7546e1e3ea840a7d25
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3871a0fca2
commit
8ddeb3ec76
@@ -76,10 +76,8 @@ public class RedundantCastUtil {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addToResults(@NotNull PsiTypeCastExpression typeCast) {
|
||||
if (!isTypeCastSemantic(typeCast)) {
|
||||
myFoundCasts.add(typeCast);
|
||||
}
|
||||
protected void registerCast(@NotNull PsiTypeCastExpression typeCast) {
|
||||
myFoundCasts.add(typeCast);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,13 +85,17 @@ public class RedundantCastUtil {
|
||||
private static class MyIsRedundantVisitor extends JavaRecursiveElementWalkingVisitor {
|
||||
private PsiTypeCastExpression foundRedundantCast;
|
||||
|
||||
protected void addToResults(@NotNull PsiTypeCastExpression typeCast){
|
||||
private void addToResults(@NotNull PsiTypeCastExpression typeCast){
|
||||
if (!isTypeCastSemantic(typeCast)) {
|
||||
foundRedundantCast = typeCast;
|
||||
stopWalking();
|
||||
registerCast(typeCast);
|
||||
}
|
||||
}
|
||||
|
||||
protected void registerCast(@NotNull PsiTypeCastExpression typeCast) {
|
||||
foundRedundantCast = typeCast;
|
||||
stopWalking();
|
||||
}
|
||||
|
||||
@Override public void visitAssignmentExpression(PsiAssignmentExpression expression) {
|
||||
processPossibleTypeCast(expression.getRExpression(), expression.getLExpression().getType());
|
||||
super.visitAssignmentExpression(expression);
|
||||
|
||||
Reference in New Issue
Block a user