};
where.acceptChildren(new MyCollectingVisitor(processor));
return result;
}
public static boolean isCastRedundant (PsiTypeCastExpression typeCast) {
<BUG>MyIsRedundantVisitor visitor = new MyIsRedundantVisitor();</BUG>
PsiElement parent = typeCast.getParent();
while(parent instanceof PsiParenthesizedExpression) parent = parent.getParent();
if (parent instanceof PsiExpressionList) parent = parent.getParent();
<BUG>if (parent instanceof PsiReferenceExpression) parent = parent.getParent();
parent.accept(visitor);</BUG>
return visitor.isRedundant();

};
where.acceptChildren(new MyCollectingVisitor(processor));
return result;
}
public static boolean isCastRedundant (PsiTypeCastExpression typeCast) {
PsiElement parent = typeCast.getParent();
while(parent instanceof PsiParenthesizedExpression) parent = parent.getParent();
if (parent instanceof PsiExpressionList) parent = parent.getParent();
if (parent instanceof PsiReferenceExpression) parent = parent.getParent();
MyIsRedundantVisitor visitor = new MyIsRedundantVisitor();
parent.accept(visitor);
return visitor.isRedundant();
