boolean (PsiElement initializer) { if (initializer == null) return false; final boolean [] dependsOnMoved = new boolean[]{false}; initializer.accept(new JavaRecursiveElementWalkingVisitor(){ @Override public void visitReferenceExpression(final @NotNull PsiReferenceExpression expression) { super.visitReferenceExpression(expression); final PsiElement resolved = expression.resolve(); if (resolved instanceof PsiMember) { dependsOnMoved[0] |= !((PsiMember)resolved).hasModifierProperty(PsiModifier.STATIC) && isInMovedElement(resolved); } } }); return dependsOnMoved[0]; }