mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[wobbler] get resolution to jdk working
GitOrigin-RevId: 98f16eb5685309cfe15faf92adf1969b7f5a22a6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c2c5590b88
commit
f3e3f0c4dd
+12
-9
@@ -134,15 +134,18 @@ public final class JavaFileManagerImpl implements JavaFileManager, Disposable {
|
||||
private boolean hasAcceptablePackage(@NotNull VirtualFile vFile) {
|
||||
if (FileTypeRegistry.getInstance().isFileOfType(vFile, JavaClassFileType.INSTANCE)) {
|
||||
// See IDEADEV-5626
|
||||
ProjectFileIndex index = ProjectRootManager.getInstance(myManager.getProject()).getFileIndex();
|
||||
boolean checkMultiRelease = index.isInLibrary(vFile);
|
||||
VirtualFile root = index.getClassRootForFile(vFile);
|
||||
VirtualFile parent = vFile.getParent();
|
||||
PsiNameHelper nameHelper = PsiNameHelper.getInstance(myManager.getProject());
|
||||
while (parent != null && !Comparing.equal(parent, root) &&
|
||||
(!checkMultiRelease || JavaMultiReleaseUtil.getVersionForVersionRoot(root, parent) == null)) {
|
||||
if (!nameHelper.isIdentifier(parent.getName())) return false;
|
||||
parent = parent.getParent();
|
||||
var prm = ProjectRootManager.getInstance(myManager.getProject());
|
||||
if (prm != null) {
|
||||
ProjectFileIndex index = prm.getFileIndex();
|
||||
boolean checkMultiRelease = index.isInLibrary(vFile);
|
||||
VirtualFile root = index.getClassRootForFile(vFile);
|
||||
VirtualFile parent = vFile.getParent();
|
||||
PsiNameHelper nameHelper = PsiNameHelper.getInstance(myManager.getProject());
|
||||
while (parent != null && !Comparing.equal(parent, root) &&
|
||||
(!checkMultiRelease || JavaMultiReleaseUtil.getVersionForVersionRoot(root, parent) == null)) {
|
||||
if (!nameHelper.isIdentifier(parent.getName())) return false;
|
||||
parent = parent.getParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public final class ClassFileDecompilers {
|
||||
return ApplicationManager.getApplication().getService(ClassFileDecompilers.class);
|
||||
}
|
||||
|
||||
public final ExtensionPointName<Decompiler> EP_NAME = new ExtensionPointName<>("com.intellij.psi.classFileDecompiler");
|
||||
public static final ExtensionPointName<Decompiler> EP_NAME = new ExtensionPointName<>("com.intellij.psi.classFileDecompiler");
|
||||
|
||||
private ClassFileDecompilers() {
|
||||
Application app = ApplicationManager.getApplication();
|
||||
|
||||
+4
-1
@@ -2,6 +2,7 @@
|
||||
package com.intellij.psi.impl.java.stubs.index;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.impl.search.JavaSourceFilterScope;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -34,7 +35,9 @@ public final class JavaFullClassNameIndex extends CharSequenceHashStubIndexExten
|
||||
}
|
||||
|
||||
public Collection<PsiClass> getClasses(@NotNull CharSequence name, @NotNull Project project, @NotNull GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), name, project, new JavaSourceFilterScope(scope), PsiClass.class);
|
||||
var prm = ProjectRootManager.getInstance(project);
|
||||
var scopePrime = prm != null ? new JavaSourceFilterScope(scope) : scope;
|
||||
return StubIndex.getElements(getKey(), name, project, scopePrime, PsiClass.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -38,7 +38,8 @@ final class CharSequenceHashInlineKeyDescriptor extends InlineKeyDescriptor<Char
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
throw new UnsupportedOperationException();
|
||||
return obj instanceof CharSequence && obj.hashCode() == hashCode;
|
||||
// throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user