Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ClassCastException for the GraphQlResolverIndex.getGraphQLUsages(GraphQlResolverIndex.java:130) #907

Closed
arthurelad opened this issue Jan 4, 2022 · 3 comments · Fixed by #927
Assignees

Comments

@arthurelad
Copy link

Describe the bug (*)

A clear and concise description of what the bug is.

java.lang.ClassCastException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:603)
	at java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:678)
	at java.base/java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:722)
	at com.intellij.concurrency.JobLauncherImpl.processQueue(JobLauncherImpl.java:357)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.processInOrder(LocalInspectionsPass.java:414)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.visitRestElementsAndCleanup(LocalInspectionsPass.java:494)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:229)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:127)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:414)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1084)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:407)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:406)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:382)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:174)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:181)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:380)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:184)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.ClassCastException: class com.intellij.psi.impl.source.PsiPlainTextFileImpl cannot be cast to class com.intellij.lang.jsgraphql.psi.GraphQLFile (com.intellij.psi.impl.source.PsiPlainTextFileImpl is in unnamed module of loader com.intellij.util.lang.PathClassLoader @cc285f4; com.intellij.lang.jsgraphql.psi.GraphQLFile is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @46ef3ade)
	at com.magento.idea.magento2plugin.stubs.indexes.graphql.GraphQlResolverIndex.getGraphQLUsages(GraphQlResolverIndex.java:130)
	at com.magento.idea.magento2plugin.util.magento.graphql.GraphQlUsagesCollector.extractGraphQLQuotesStringsForClass(GraphQlUsagesCollector.java:34)
	at com.magento.idea.magento2plugin.util.magento.graphql.GraphQlUsagesCollector.getUsages(GraphQlUsagesCollector.java:27)
	at com.magento.idea.magento2plugin.util.magento.graphql.GraphQlUsagesCollector.getGraphQLUsages(GraphQlUsagesCollector.java:19)
	at com.magento.idea.magento2plugin.inspections.php.GraphQlResolverInspection$1.visitPhpClass(GraphQlResolverInspection.java:34)
	at com.jetbrains.php.lang.psi.elements.impl.PhpClassImpl.accept(PhpClassImpl.java:647)
	at com.jetbrains.php.lang.psi.elements.impl.PhpPsiElementImpl.accept(PhpPsiElementImpl.java:73)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$processInOrder$8(LocalInspectionsPass.java:439)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1084)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$processInOrder$9(LocalInspectionsPass.java:417)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:174)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:181)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$processInOrder$10(LocalInspectionsPass.java:452)
	at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:159)
	at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:151)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$processInOrder$11(LocalInspectionsPass.java:415)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:130)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:119)
	at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$processInOrder$12(LocalInspectionsPass.java:415)
	at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.lambda$call$0(JobLauncherImpl.java:297)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:64

To Reproduce (*)

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior (*)

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following information: (*)

  • OS: Mac OS X 11.6
  • PhpStorm/Intellij version: 2021.3.1
  • Plugin Version: 4.2.1

Additional context

Add any other context about the problem here.

@arthurelad arthurelad added the bug label Jan 4, 2022
@m2-assistant
Copy link

m2-assistant bot commented Jan 4, 2022

Hi @arthurelad. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


@bohdan-harniuk
Copy link
Collaborator

Hello, @arthurelad !

Thank you for your report!
We'll try to include a fix in the next release.

Regards,

@bohdan-harniuk bohdan-harniuk removed their assignment Jan 21, 2022
@bohdan-harniuk bohdan-harniuk changed the title Bug Report 2022/01/04 [Bug] ClassCastException for the GraphQlResolverIndex.getGraphQLUsages(GraphQlResolverIndex.java:130) Jan 21, 2022
@doninAtwix
Copy link
Contributor

@magento I am working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants