PsiType (PsiType forcedType, PsiExpression parameterInitializer, PsiLocalVariable localVariable) { final PsiType initializerType; if (forcedType == null) { if (parameterInitializer == null) { if (localVariable == null) { LOG.error("all null"); initializerType = null; } else { initializerType = localVariable.getType(); } } else { if (localVariable == null) { initializerType = CommonJavaRefactoringUtil.getTypeByExpressionWithExpectedType(parameterInitializer); } else { initializerType = localVariable.getType(); } } } else { initializerType = forcedType; } return initializerType; }