diff --git a/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java b/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java index 28c5c702c42b..ab6289584719 100644 --- a/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/JavaPsiImplementationHelperImpl.java @@ -119,7 +119,9 @@ public class JavaPsiImplementationHelperImpl extends JavaPsiImplementationHelper ProjectFileIndex projectFileIndex = ProjectFileIndex.SERVICE.getInstance(clsFile.getProject()); final Set sourceRoots = ContainerUtil.newLinkedHashSet(); for (OrderEntry orderEntry : projectFileIndex.getOrderEntriesForFile(vFile)) { - Collections.addAll(sourceRoots, orderEntry.getFiles(OrderRootType.SOURCES)); + if (orderEntry instanceof LibraryOrSdkOrderEntry) { + Collections.addAll(sourceRoots, orderEntry.getFiles(OrderRootType.SOURCES)); + } } for (VirtualFile root : sourceRoots) { VirtualFile source = root.findFileByRelativePath(relativeFilePath);