boolean (PsiLocalVariable variable) { PsiElement block = PsiUtil.getVariableCodeBlock(variable, null); if (block == null) return false; List<PsiReferenceExpression> refs = VariableAccessUtils.getVariableReferences(variable, block); boolean isAccessedForWriting = false; for (PsiReferenceExpression refElement : refs) { if (PsiUtil.isAccessedForWriting(refElement)) { isAccessedForWriting = true; } } if (refs.size() == 1 && !isAccessedForWriting && isFirstUse(variable, refs.get(0))) return true; PsiExpression initializer = variable.getInitializer(); return canInlineParameterOrThisVariable(variable.getProject(), initializer, false, false, refs.size(), isAccessedForWriting); }