mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-167532 skip duplicated jars in retrieving of language level for files under a library source root
This commit is contained in:
@@ -49,9 +49,7 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -170,12 +168,15 @@ public class JavaPsiImplementationHelperImpl extends JavaPsiImplementationHelper
|
||||
return null;
|
||||
}
|
||||
String className = virtualFile.getNameWithoutExtension();
|
||||
Set<VirtualFile> visitedRoots = ContainerUtil.newHashSet();
|
||||
for (OrderEntry entry : index.getOrderEntriesForFile(virtualFile)) {
|
||||
for (VirtualFile rootFile : entry.getFiles(OrderRootType.CLASSES)) {
|
||||
VirtualFile classFile = rootFile.findFileByRelativePath(relativePath);
|
||||
PsiJavaFile javaFile = classFile == null ? null : getPsiFileInRoot(classFile, className);
|
||||
if (javaFile != null) {
|
||||
return javaFile.getLanguageLevel();
|
||||
if (visitedRoots.add(rootFile)) {
|
||||
VirtualFile classFile = rootFile.findFileByRelativePath(relativePath);
|
||||
PsiJavaFile javaFile = classFile == null ? null : getPsiFileInRoot(classFile, className);
|
||||
if (javaFile != null) {
|
||||
return javaFile.getLanguageLevel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user