redundant casts: exclude casts from primitive types in synchronized stms (IDEA-58637 )

This commit is contained in:
anna
2011-08-24 21:13:56 +02:00
parent 12fbfe579f
commit a6c2368498
4 changed files with 14 additions and 0 deletions
@@ -353,6 +353,8 @@ public class RedundantCastUtil {
//branches need to be of the same type
if (!Comparing.equal(operand.getType(), ((PsiConditionalExpression)parent).getType())) return;
}
} else if (parent instanceof PsiSynchronizedStatement && (expr instanceof PsiExpression && ((PsiExpression)expr).getType() instanceof PsiPrimitiveType)) {
return;
}
processAlreadyHasTypeCast(typeCast);
}