PsiElement (PsiMethodCallExpression callExpression) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(myProject); PsiClass psiClass = myExtractedMethod.getContainingClass(); LOG.assertTrue(psiClass != null, "myExtractedMethod.getContainingClass"); PsiReferenceExpression newQualifier = factory.createReferenceExpression(psiClass); callExpression.getMethodExpression().setQualifierExpression(newQualifier); return JavaCodeStyleManager.getInstance(myProject).shortenClassReferences(callExpression); }