manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.43k stars 125 forks source link

Stub index points to a file without PSI: SystemModules$all.class #357

Open voidpointer0x00 opened 2 years ago

voidpointer0x00 commented 2 years ago

Describe the bug, expected behavior, to reproduce Honestly, I've no clue :). I did not notice any behaviour error, from time to time there is only an exception report (I've encountered this only two or three times while writing some code).

At the moment when the exception was thrown, I was writing this (perhaps pressed ctrl+space):

public void schedule(final @NonNull Whitelistable whitelistable) {
    if (!whitelistable.isExpirable())
        return;
    long delay = whitelistable.getExpiresAt().getTime() - System.ge // cursor being here
}

Yeah #currentTimeMillis() is the right one :)

Desktop:

Stack trace

java.lang.Throwable: Stub index points to a file without PSI: file = jrt:///opt/jdk/jdk-17.0.2!/java.base/jdk/internal/module/SystemModules$all.class, file type = com.intellij.ide.highlighter.JavaClassFileType@7c3edc85, indexed file type = com.intellij.ide.highlighter.JavaClassFileType@7c3edc85, indexing stamp info = indexing timestamp = 1638913960000, binary = true, byte size = 78009, char size = -1, used scope = com.intellij.psi.impl.search.JavaSourceFilterScope[Union: (Module-with-dependencies:voidwhitelist compile-only:true include-libraries:true include-other-modules:true include-tests:false,File: LightVirtualFile: /KickTaskScheduler.java)]
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
    at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:52)
    at com.intellij.psi.stubs.StubIndexEx.lambda$processElements$4(StubIndexEx.java:140)
    at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:187)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:99)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:87)
    at com.intellij.psi.impl.java.stubs.index.JavaShortClassNameIndex.get(JavaShortClassNameIndex.java:35)
    at com.intellij.psi.impl.PsiShortNamesCacheImpl.getClassesByName(PsiShortNamesCacheImpl.java:49)
    at com.intellij.psi.impl.CompositeShortNamesCache.getClassesByName(CompositeShortNamesCache.java:68)
    at com.intellij.psi.impl.search.AllClassesSearchExecutor.lambda$processByName$3(AllClassesSearchExecutor.java:80)
    at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:113)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:144)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:113)
    at com.intellij.psi.impl.search.AllClassesSearchExecutor.processByName(AllClassesSearchExecutor.java:80)
    at com.intellij.psi.impl.search.AllClassesSearchExecutor.processClassesByNames(AllClassesSearchExecutor.java:70)
    at com.intellij.codeInsight.completion.AllClassesGetter.processJavaClasses(AllClassesGetter.java:137)
    at com.intellij.codeInsight.completion.JavaClassNameCompletionContributor.addAllClasses(JavaClassNameCompletionContributor.java:194)
    at com.intellij.codeInsight.completion.JavaNoVariantsDelegator.suggestNonImportedClasses(JavaNoVariantsDelegator.java:211)
    at com.intellij.codeInsight.completion.JavaNoVariantsDelegator.fillCompletionVariants(JavaNoVariantsDelegator.java:79)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:154)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:146)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142)
    at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.addCompletions(LiveTemplateCompletionContributor.java:89)
    at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:25)
    at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:157)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:154)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:146)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142)
    at manifold.ij.extensions.ManJavaCompletionContributor.fillCompletionVariants(ManJavaCompletionContributor.java:53)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:59)
    at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:132)
    at com.intellij.codeInsight.completion.BaseCompletionService.performCompletion(BaseCompletionService.java:43)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.lambda$calculateItems$11(CompletionProgressIndicator.java:870)
    at com.intellij.util.indexing.FileBasedIndex.lambda$ignoreDumbMode$0(FileBasedIndex.java:202)
    at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114)
    at com.intellij.util.indexing.FileBasedIndexEx.ignoreDumbMode(FileBasedIndexEx.java:677)
    at com.intellij.util.indexing.FileBasedIndex.ignoreDumbMode(FileBasedIndex.java:201)
    at com.intellij.util.indexing.DumbModeAccessType.ignoreDumbMode(DumbModeAccessType.java:43)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:866)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:854)
    at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$6(CodeCompletionHandlerBase.java:352)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$tryReadOrCancel$5(CompletionThreading.java:172)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1152)
    at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:170)
    at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$7(CodeCompletionHandlerBase.java:344)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$0(CompletionThreading.java:95)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$1(CompletionThreading.java:91)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:295)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)