void (PsiExpression expr, float newValue) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(expr.getProject()); if (getFloat(expr) != newValue) { expr.replace(factory.createExpressionFromText(newValue + "f", null)); } }