private void processAlreadyHasTypeCast(PsiTypeCastExpression typeCast){
PsiElement parent = typeCast.getParent();
while(parent instanceof PsiParenthesizedExpression) parent = parent.getParent();
if (parent instanceof PsiExpressionList) return; // do not replace in arg lists - should be handled by parent
if (isTypeCastSemantical(typeCast)) return;
<BUG>PsiType toType = typeCast.getCastType().getType();

PsiType fromType = typeCast.getOperand().getType();</BUG>
if (fromType == null) return;
if (parent instanceof PsiReferenceExpression) {

private void processAlreadyHasTypeCast(PsiTypeCastExpression typeCast){
PsiElement parent = typeCast.getParent();
while(parent instanceof PsiParenthesizedExpression) parent = parent.getParent();
if (parent instanceof PsiExpressionList) return; // do not replace in arg lists - should be handled by parent
if (isTypeCastSemantical(typeCast)) return;
PsiTypeElement typeElement = typeCast.getCastType();
if (typeElement == null) return;
PsiType toType = typeElement.getType();
PsiType fromType = typeCast.getOperand().getType();
if (fromType == null) return;
if (parent instanceof PsiReferenceExpression) {
