[java-highlighting] Do not try to resolve star-import if existing explicit import fails to resolve

Otherwise, wrong class may be resolved in incomplete project model
AnonymousHashCode.java changed, because java.lang.Object import was unresolved (no JDK configured) and we now refuse to resolve to same-package class if there's a suitable explicit import
beforeHierarchy.java/afterHierarchy.java changed, because the import was incorrect, and it prevented importing implicit java.lang.Exception
predicates2.java changed: incorrect import removed (now prevents importing java.lang.String)
MoveInnerProcessor changes: import refs should be rebound first; otherwise they disallow to rebind normal refs
SpringDataMongoDbQueryCompletionTest changed: erroneous import removed

GitOrigin-RevId: f380409c445306bb9b8aceb5fe4dce1351511283
This commit is contained in:
Tagir Valeev
2024-05-27 19:04:40 +02:00
committed by intellij-monorepo-bot
parent 9c798596c3
commit a8788fa3b8
11 changed files with 56 additions and 16 deletions

View File

@@ -231,6 +231,7 @@ public class MoveInnerProcessor extends BaseRefactoringProcessor {
}
}
}
referencesToRebind.sort(Comparator.comparing(ref -> !(ref instanceof PsiImportStaticReferenceElement)));
myInnerClass.delete();