facebook / ktfmt

A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
https://facebook.github.io/ktfmt/
Apache License 2.0
919 stars 77 forks source link

java.lang.IllegalArgumentException was thrown at: org.jetbrains.kotlin.resolve.AnnotationResolverImpl.$$$reportNull$$$0(AnnotationResolverImpl.java) #375

Closed mschaaf closed 5 months ago

mschaaf commented 1 year ago
java.lang.IllegalStateException: failed to analyze: org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration SimpleHoopFrameListDto
File being compiled: (152,1) in /home/ms/workspace/assortment-system/src/main/kotlin/net/sprd/assortmentsystem/endpoints/fe/administration/HoopFrameAdministrationService.kt
The root cause java.lang.IllegalArgumentException was thrown at: org.jetbrains.kotlin.resolve.AnnotationResolverImpl.$$$reportNull$$$0(AnnotationResolverImpl.java)
    at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:56)
    at org.jetbrains.kotlin.idea.highlighter.AbstractKotlinHighlightVisitor.analyze(AbstractKotlinHighlightVisitor.kt:116)
    at org.jetbrains.kotlin.idea.highlighter.AbstractKotlinHighlightVisitor.analyze(AbstractKotlinHighlightVisitor.kt:49)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:307)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$8(GeneralHighlightingPass.java:307)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:93)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:307)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:274)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:222)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:97)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:405)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1086)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:397)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:591)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:666)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:622)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:590)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:396)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:372)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:174)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:370)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:181)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration SimpleHoopFrameListDto
File being compiled: (152,1) in /home/ms/workspace/assortment-system/src/main/kotlin/net/sprd/assortmentsystem/endpoints/fe/administration/HoopFrameAdministrationService.kt
The root cause java.lang.IllegalArgumentException was thrown at: org.jetbrains.kotlin.resolve.AnnotationResolverImpl.$$$reportNull$$$0(AnnotationResolverImpl.java)
    at org.jetbrains.kotlin.resolve.ExceptionWrappingKtVisitorVoid.visitDeclaration(ExceptionWrappingKtVisitorVoid.kt:43)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitDeclaration(KtVisitorVoid.java:461)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitDeclaration(KtVisitorVoid.java:21)
    at org.jetbrains.kotlin.psi.KtVisitor.visitNamedDeclaration(KtVisitor.java:406)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitNamedDeclaration(KtVisitorVoid.java:385)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitNamedDeclaration(KtVisitorVoid.java:973)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitNamedDeclaration(KtVisitorVoid.java:21)
    at org.jetbrains.kotlin.psi.KtVisitor.visitClassOrObject(KtVisitor.java:41)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClassOrObject(KtVisitorVoid.java:37)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClassOrObject(KtVisitorVoid.java:473)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClassOrObject(KtVisitorVoid.java:21)
    at org.jetbrains.kotlin.psi.KtVisitor.visitClass(KtVisitor.java:33)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClass(KtVisitorVoid.java:33)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClass(KtVisitorVoid.java:467)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClass(KtVisitorVoid.java:21)
    at org.jetbrains.kotlin.psi.KtClass.accept(KtClass.kt:22)
    at org.jetbrains.kotlin.psi.KtElementImplStub.accept(KtElementImplStub.java:49)
    at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer$analyzeDeclarations$1.registerDeclarations(LazyTopDownAnalyzer.kt:80)
    at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer$analyzeDeclarations$1.visitKtFile(LazyTopDownAnalyzer.kt:98)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitKtFile(KtVisitorVoid.java:521)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitKtFile(KtVisitorVoid.java:21)
    at org.jetbrains.kotlin.psi.KtFile.accept(KtFile.kt:250)
    at org.jetbrains.kotlin.psi.KtFile.accept(KtFile.kt:237)
    at org.jetbrains.kotlin.resolve.ExceptionWrappingKtVisitorVoid.visitElement(ExceptionWrappingKtVisitorVoid.kt:27)
    at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:51)
    at org.jetbrains.kotlin.psi.KtVisitor.visitKtFile(KtVisitor.java:73)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitKtFile(KtVisitorVoid.java:69)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitKtFile(KtVisitorVoid.java:521)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitKtFile(KtVisitorVoid.java:21)
    at org.jetbrains.kotlin.psi.KtFile.accept(KtFile.kt:250)
    at org.jetbrains.kotlin.psi.KtFile.accept(KtFile.kt:237)
    at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations(LazyTopDownAnalyzer.kt:203)
    at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations$default(LazyTopDownAnalyzer.kt:58)
    at org.jetbrains.kotlin.idea.caches.resolve.KotlinResolveDataProvider.analyze(PerFileAnalysisCache.kt:577)
    at org.jetbrains.kotlin.idea.caches.resolve.PerFileAnalysisCache.analyze(PerFileAnalysisCache.kt:287)
    at org.jetbrains.kotlin.idea.caches.resolve.PerFileAnalysisCache.access$analyze(PerFileAnalysisCache.kt:57)
    at org.jetbrains.kotlin.idea.caches.resolve.PerFileAnalysisCache.getAnalysisResults$kotlin_base_fe10_analysis(PerFileAnalysisCache.kt:132)
    at org.jetbrains.kotlin.idea.caches.resolve.ProjectResolutionFacade.analysisResultForElement(ProjectResolutionFacade.kt:236)
    at org.jetbrains.kotlin.idea.caches.resolve.ProjectResolutionFacade.getAnalysisResultsForElement$kotlin_base_fe10_analysis(ProjectResolutionFacade.kt:209)
    at org.jetbrains.kotlin.idea.caches.resolve.ModuleResolutionFacadeImpl$analyzeWithAllCompilerChecks$1.invoke(ModuleResolutionFacadeImpl.kt:79)
    at org.jetbrains.kotlin.idea.caches.resolve.ModuleResolutionFacadeImpl$analyzeWithAllCompilerChecks$1.invoke(ModuleResolutionFacadeImpl.kt:78)
    at com.intellij.openapi.progress.impl.CancellationCheck.withCancellationCheck(CancellationCheck.kt:59)
    at com.intellij.openapi.progress.impl.CancellationCheck$Companion.runWithCancellationCheck(CancellationCheck.kt:105)
    at org.jetbrains.kotlin.idea.util.application.ApplicationUtilsKt.runWithCancellationCheck(ApplicationUtils.kt:56)
    at org.jetbrains.kotlin.idea.caches.resolve.ModuleResolutionFacadeImpl.analyzeWithAllCompilerChecks(ModuleResolutionFacadeImpl.kt:78)
    at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeWithDebugInfo.analyzeWithAllCompilerChecks(ResolutionFacadeWithDebugInfo.kt:59)
    at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.analyzeWithAllCompilerChecks(ResolutionUtils.kt:171)
    at org.jetbrains.kotlin.idea.highlighter.AbstractKotlinHighlightVisitor.analyze(AbstractKotlinHighlightVisitor.kt:91)
    ... 28 more
Caused by: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'scope' of org/jetbrains/kotlin/resolve/AnnotationResolverImpl.resolveAnnotationType must not be null
    at org.jetbrains.kotlin.resolve.AnnotationResolverImpl.$$$reportNull$$$0(AnnotationResolverImpl.java)
    at org.jetbrains.kotlin.resolve.AnnotationResolverImpl.resolveAnnotationType(AnnotationResolverImpl.java)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$type$2.invoke(LazyAnnotations.kt:87)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$type$2.invoke(LazyAnnotations.kt:85)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.getType(LazyAnnotations.kt:85)
    at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getAnnotationClass(DescriptorUtils.kt:395)
    at org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor$DefaultImpls.getFqName(AnnotationDescriptor.kt:34)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.getFqName(LazyAnnotations.kt:76)
    at org.jetbrains.kotlin.descriptors.annotations.Annotations$DefaultImpls.findAnnotation(Annotations.kt:29)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotations.findAnnotation(LazyAnnotations.kt:56)
    at org.jetbrains.kotlin.descriptors.annotations.Annotations$DefaultImpls.hasAnnotation(Annotations.kt:31)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotations.hasAnnotation(LazyAnnotations.kt:56)
    at org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt.isJvmRecord(jvmAnnotationUtil.kt:107)
    at org.jetbrains.kotlin.resolve.jvm.JvmAdditionalClassPartsProvider.getAdditionalSupertypes(JvmAdditionalClassPartsProvider.kt:38)
    at org.jetbrains.kotlin.resolve.DescriptorResolver.resolveSupertypes(DescriptorResolver.java:166)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.computeSupertypes(LazyClassDescriptor.java:873)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor$LazyClassTypeConstructor.computeSupertypes(LazyClassDescriptor.java:770)
    at org.jetbrains.kotlin.types.AbstractTypeConstructor$supertypes$1.invoke(AbstractTypeConstructor.kt:78)
    at org.jetbrains.kotlin.types.AbstractTypeConstructor$supertypes$1.invoke(AbstractTypeConstructor.kt:77)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValueWithPostCompute.invoke(LockBasedStorageManager.java:481)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValueWithPostCompute.invoke(LockBasedStorageManager.java:512)
    at org.jetbrains.kotlin.types.AbstractTypeConstructor.getSupertypes(AbstractTypeConstructor.kt:27)
    at org.jetbrains.kotlin.types.AbstractTypeConstructor.getSupertypes(AbstractTypeConstructor.kt:26)
    at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getSuperClassNotAny(DescriptorUtils.kt:145)
    at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.getAllSuperclassesWithoutAny(DescriptorUtils.kt:364)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.ClassResolutionScopesSupport$inheritanceScopeWithoutMe$1.invoke(ClassResolutionScopesSupport.kt:50)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.ClassResolutionScopesSupport$inheritanceScopeWithoutMe$1.invoke(ClassResolutionScopesSupport.kt:49)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.ClassResolutionScopesSupport$inheritanceScopeWithMe$1.invoke(ClassResolutionScopesSupport.kt:56)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.ClassResolutionScopesSupport$inheritanceScopeWithMe$1.invoke(ClassResolutionScopesSupport.kt:55)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.ClassResolutionScopesSupport$scopeForConstructorHeaderResolution$1.invoke(ClassResolutionScopesSupport.kt:46)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.ClassResolutionScopesSupport$scopeForConstructorHeaderResolution$1.invoke(ClassResolutionScopesSupport.kt:45)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.getScopeForConstructorHeaderResolution(LazyClassDescriptor.java:425)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.resolvePrimaryConstructor(LazyClassMemberScope.kt:537)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$primaryConstructor$1.invoke(LazyClassMemberScope.kt:206)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$primaryConstructor$1.invoke(LazyClassMemberScope.kt:206)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getPrimaryConstructor(LazyClassMemberScope.kt:524)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.createPropertiesFromPrimaryConstructorParameters(LazyClassMemberScope.kt:439)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getNonDeclaredProperties(LazyClassMemberScope.kt:424)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.doGetProperties(AbstractLazyMemberScope.kt:150)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.access$doGetProperties(AbstractLazyMemberScope.kt:38)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$propertyDescriptors$1.invoke(AbstractLazyMemberScope.kt:53)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$propertyDescriptors$1.invoke(AbstractLazyMemberScope.kt:53)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:578)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunctionToNotNull.invoke(LockBasedStorageManager.java:651)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getContributedVariables(AbstractLazyMemberScope.kt:144)
    at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getContributedVariables(LazyClassMemberScope.kt:409)
    at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitParameter(LazyDeclarationResolver.kt:139)
    at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitParameter(LazyDeclarationResolver.kt:94)
    at org.jetbrains.kotlin.psi.KtParameter.accept(KtParameter.java:50)
    at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:94)
    at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:91)
    at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer$analyzeDeclarations$1.registerPrimaryConstructorParameters(LazyTopDownAnalyzer.kt:157)
    at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer$analyzeDeclarations$1.visitClass(LazyTopDownAnalyzer.kt:149)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClass(KtVisitorVoid.java:467)
    at org.jetbrains.kotlin.psi.KtVisitorVoid.visitClass(KtVisitorVoid.java:21)
    at org.jetbrains.kotlin.psi.KtClass.accept(KtClass.kt:22)
    at org.jetbrains.kotlin.psi.KtElementImplStub.accept(KtElementImplStub.java:49)
    at org.jetbrains.kotlin.resolve.ExceptionWrappingKtVisitorVoid.visitDeclaration(ExceptionWrappingKtVisitorVoid.kt:32)
    ... 75 more
hick209 commented 5 months ago

Could you provide more info on the issue here.

Can you still repro it? How could we reproduce the error?

I'll close it since it's very old, but feel free to reopen if the issue still happens to you