void (PushDownData<MemberInfo, PsiMember> pushDownData) { final Set<PsiMember> movedMembers = new HashSet<>(); for (MemberInfoBase<? extends PsiElement> memberInfo : pushDownData.getMembersToMove()) { movedMembers.add((PsiMember)memberInfo.getMember()); } for (MemberInfoBase<? extends PsiElement> memberInfo : pushDownData.getMembersToMove()) { final PsiElement member = memberInfo.getMember(); member.accept(new JavaRecursiveElementVisitor() { @Override public void visitThisExpression(@NotNull PsiThisExpression expression) { encodeRef((PsiClass)pushDownData.getSourceClass(), null, movedMembers, expression, expression); super.visitThisExpression(expression); } @Override public void visitReferenceElement(@NotNull PsiJavaCodeReferenceElement referenceElement) { encodeRef((PsiClass)pushDownData.getSourceClass(), referenceElement, movedMembers, referenceElement); super.visitReferenceElement(referenceElement); } @Override public void visitNewExpression(@NotNull PsiNewExpression expression) { final PsiJavaCodeReferenceElement classReference = expression.getClassReference(); if (classReference != null) { encodeRef((PsiClass)pushDownData.getSourceClass(), classReference, movedMembers, expression); } super.visitNewExpression(expression); } @Override public void visitTypeElement(final @NotNull PsiTypeElement type) { final PsiJavaCodeReferenceElement referenceElement = type.getInnermostComponentReferenceElement(); if (referenceElement != null) { encodeRef((PsiClass)pushDownData.getSourceClass(), referenceElement, movedMembers, type); } super.visitTypeElement(type); } }); ChangeContextUtil.encodeContextInfo(member, false); } }