LocalQuickFix (@NotNull PsiPrefixExpression prefixExpr) { final PsiElement parent = PsiUtil.skipParenthesizedExprUp(prefixExpr.getParent()); final PsiExpression operandExpr; final PsiExpression expr; final boolean minusOnTheLeft; final PsiExpression operand = PsiUtil.skipParenthesizedExprDown(prefixExpr.getOperand()); if (operand == null) { return null; } if (parent instanceof PsiPrefixExpression && ConvertDoubleUnaryToPrefixOperationFix.isDesiredPrefixExpression((PsiPrefixExpression)parent, false)) { operandExpr = prefixExpr.getOperand(); expr = (PsiExpression)parent; minusOnTheLeft = false; } else if (operand instanceof PsiPrefixExpression && ConvertDoubleUnaryToPrefixOperationFix.isDesiredPrefixExpression((PsiPrefixExpression)operand, false)) { operandExpr = ((PsiPrefixExpression)operand).getOperand(); expr = prefixExpr; minusOnTheLeft = true; } else { return null; } if (operandExpr == null) { return null; } final PsiType type = operandExpr.getType(); if (TypeUtils.unaryNumericPromotion(type) != type && MethodCallUtils.isNecessaryForSurroundingMethodCall(expr, operandExpr)) { return null; } return new RemoveDoubleUnaryMinusFix(minusOnTheLeft); }