mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
copy: notify about errors & disable copy classes for package-info.class
IDEA-178002: compiled file contains class though source has no classes, thus was copied as file
This commit is contained in:
@@ -84,6 +84,7 @@ public class CopyClassesHandler extends CopyHandlerDelegateBase {
|
||||
final PsiFile containingFile = navigationElement.getContainingFile();
|
||||
if (!(containingFile instanceof PsiClassOwner &&
|
||||
JavaProjectRootsUtil.isOutsideJavaSourceRoot(containingFile))) {
|
||||
if (PsiPackage.PACKAGE_INFO_CLS_FILE.equals(containingFile.getName())) continue;
|
||||
PsiClass[] topLevelClasses = getTopLevelClasses(element);
|
||||
if (topLevelClasses == null) {
|
||||
if (element instanceof PsiDirectory) {
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ public class CopyFilesOrDirectoriesHandler extends CopyHandlerDelegateBase {
|
||||
}
|
||||
|
||||
final Project project = targetDirectory.getProject();
|
||||
if (!CommonRefactoringUtil.checkReadOnlyStatus(project, Collections.singleton(targetDirectory), false)) {
|
||||
if (!CommonRefactoringUtil.checkReadOnlyStatus(project, Collections.singleton(targetDirectory), true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user