Context (@Nullable PsiLocalVariable variable, @Nullable PsiAssignmentExpression assignment) { if (variable != null && assignment != null) { String variableName = variable.getName(); PsiExpression rExpression = assignment.getRExpression(); if (rExpression != null) { for (PsiLocalVariable aVar = variable; aVar != null; aVar = getNextSiblingOfType(aVar, PsiLocalVariable.class)) { if (variableIsUsed(aVar, rExpression)) { return null; } } return new Context(variable, assignment, variableName); } } return null; }