PsiDirectory (final VirtualFile file) { final VirtualFile sourceRoot = myFileIndex.getSourceRootForFile(file); LOG.assertTrue(sourceRoot != null); return CommonJavaRefactoringUtil.findPackageDirectoryInSourceRoot(myPackage, sourceRoot); }