void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiIdentifier nameIdentifier = (PsiIdentifier)startElement; final PsiReferenceExpression reference = (PsiReferenceExpression)nameIdentifier.getParent(); assert reference != null; final PsiMethodCallExpression call = (PsiMethodCallExpression)reference.getParent(); assert call != null; final PsiExpressionList argumentList = call.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); final String methodName = reference.getReferenceName(); final PsiExpression argument = arguments[0]; final PsiMethod method = call.resolveMethod(); if (method == null) { return; } final PsiParameterList parameterList = method.getParameterList(); final PsiParameter[] parameters = parameterList.getParameters(); if (parameters.length != 1) { return; } final PsiType type = parameters[0].getType(); final Object argumentValue = ConstantExpressionUtil.computeCastTo(argument, type); final String newExpression; if (argumentValue instanceof Float || argumentValue instanceof Double) { final Number number = (Number)argumentValue; newExpression = createValueString(methodName, number.doubleValue()); } else { final Number number = (Number)argumentValue; newExpression = createValueString(methodName, number.longValue()); } if (newExpression == null) { return; } if (PsiTypes.longType().equals(type)) { PsiReplacementUtil.replaceExpressionAndShorten(call, newExpression + 'L', new CommentTracker()); } else { PsiReplacementUtil.replaceExpressionAndShorten(call, newExpression, new CommentTracker()); } }