jshiell / checkstyle-idea

CheckStyle plug-in for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
Other
889 stars 161 forks source link

Exception in plugin ->"Please, do not use constructor injection: it slows down initialization and may lead to performance problems" #653

Closed Study19999 closed 3 weeks ago

Study19999 commented 1 month ago

After installation of the new 5.95.0 CheckStyle-IDEA plugin and restart of the IDE the following error appears

"com.intellij.diagnostic.PluginException: Please, do not use constructor injection: it slows down initialization and may lead to performance problems (requestorClass=org.infernus.idea.checkstyle.util.ProjectFilePaths)). See https://plugins.jetbrains.com/docs/intellij/plugin-services.html for details. [Plugin: CheckStyle-IDEA]
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89)
    at com.intellij.diagnostic.PluginException.logPluginError(PluginException.java:111)
    at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:82)
    at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:1011)
    at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:47)
    at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:43)
    at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:158)
    at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:137)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:94)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:676)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:630)
    at org.infernus.idea.checkstyle.model.FileConfigurationLocation.projectFilePaths(FileConfigurationLocation.java:162)
    at org.infernus.idea.checkstyle.model.RelativeFileConfigurationLocation.setLocation(RelativeFileConfigurationLocation.java:29)
    at org.infernus.idea.checkstyle.model.ConfigurationLocationFactory.create(ConfigurationLocationFactory.java:78)
    at org.infernus.idea.checkstyle.config.ProjectConfigurationState$ProjectSettings.deserialiseLocation(ProjectConfigurationState.java:196)
    at org.infernus.idea.checkstyle.config.ProjectConfigurationState$ProjectSettings.lambda$deserialiseLocations$3(ProjectConfigurationState.java:161)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
    at org.infernus.idea.checkstyle.config.ProjectConfigurationState$ProjectSettings.deserialiseLocations(ProjectConfigurationState.java:163)
    at org.infernus.idea.checkstyle.config.ProjectConfigurationState$ProjectSettings.populate(ProjectConfigurationState.java:149)
    at org.infernus.idea.checkstyle.config.ProjectConfigurationState.populate(ProjectConfigurationState.java:63)
    at org.infernus.idea.checkstyle.config.PluginConfigurationManager.getCurrent(PluginConfigurationManager.java:46)
    at org.infernus.idea.checkstyle.checker.PsiFileValidator.isInSource(PsiFileValidator.java:68)
    at org.infernus.idea.checkstyle.checker.PsiFileValidator.isScannable(PsiFileValidator.java:37)
    at org.infernus.idea.checkstyle.checker.ScannableFile.lambda$createAndValidate$0(ScannableFile.java:79)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
    at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853)
    at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
    at org.infernus.idea.checkstyle.checker.ScannableFile.lambda$createAndValidate$2(ScannableFile.java:86)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:76)
    at org.infernus.idea.checkstyle.checker.ScannableFile.createAndValidate(ScannableFile.java:87)
    at org.infernus.idea.checkstyle.CheckStyleInspection.checkFile(CheckStyleInspection.java:71)
    at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:138)
    at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:489)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$10(InspectionRunner.java:334)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$11(InspectionRunner.java:342)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:201)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:207)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$12(InspectionRunner.java:348)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:159)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:151)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$13(InspectionRunner.java:311)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:130)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:119)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$14(InspectionRunner.java:311)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.lambda$call$0(JobLauncherImpl.java:314)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:299)
    at com.intellij.concurrency.JobLauncherImpl.processQueue(JobLauncherImpl.java:367)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.processInOrder(InspectionRunner.java:310)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.visitElements(InspectionRunner.java:285)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$4(InspectionRunner.java:138)
    at com.intellij.codeInspection.InspectionEngine.withSession(InspectionEngine.java:227)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.inspect(InspectionRunner.java:115)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:113)
    at com.intellij.codeInsight.daemon.impl.WholeFileLocalInspectionsPassFactory$1.collectInformationWithProgress(WholeFileLocalInspectionsPassFactory.java:74)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:95)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:390)
    at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.runWithSpanIgnoreThrows(trace.kt:77)
    at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.runWithSpanThrows(TraceUtil.java:24)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:386)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:377)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:376)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:352)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:201)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:207)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:350)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:190)
    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)   

which makes the plugin unusable. Is there something that can be done about it?

jshiell commented 1 month ago

Thanks for the report. What version of IDEA are you using, please?

Study19999 commented 1 month ago

I am using the 2023.2 Community version.

drewboston commented 3 weeks ago

Also seeing this on the 2023.1.6 ultimate edition.

If it helps, here's a similar issue logged for the flutter plugin: https://github.com/flutter/flutter-intellij/issues/6613

jshiell commented 3 weeks ago

Thanks - I know what it’ll be, as JetBrains and I have a fundamental disagreement on object construction 😂 it’s just finding the time to fix it - I’ll try do it this weekend before my next bout of business travel 🤞

drewboston commented 3 weeks ago

It's not causing any issues (for me at least), so no rush! Appreciate it though!

jshiell commented 3 weeks ago

Should be fixed in 5.96.0 🤞