Netflix / dgs-intellij-plugin

Apache License 2.0
22 stars 11 forks source link

NullPointerException using directive #63

Closed esfomeado closed 1 year ago

esfomeado commented 1 year ago

Type the following in a new schema:

type Message @connection

The following error is thrown:

java.lang.NullPointerException
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:564)
    at java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:591)
    at java.base/java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:672)
    at com.intellij.concurrency.JobLauncherImpl.processQueue(JobLauncherImpl.java:360)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.processInOrder(InspectionRunner.java:299)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.visitElements(InspectionRunner.java:274)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$4(InspectionRunner.java:129)
    at com.intellij.codeInspection.InspectionEngine.withSession(InspectionEngine.java:227)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.inspect(InspectionRunner.java:114)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:115)
    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:382)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:374)
    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:60)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:373)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:349)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:229)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:187)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:347)
    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: java.lang.NullPointerException: null cannot be cast to non-null type com.intellij.lang.jsgraphql.psi.impl.GraphQLIdentifierImpl
    at com.netflix.dgs.plugin.hints.DgsEntityFetcherInspector$buildVisitor$1.visitElement(DgsEntityFetcherInspector.kt:49)
    at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:273)
    at com.intellij.lang.jsgraphql.psi.impl.GraphQLDefinitionImpl.accept(GraphQLDefinitionImpl.java:26)
    at com.intellij.lang.jsgraphql.psi.impl.GraphQLTypeSystemDefinitionImpl.accept(GraphQLTypeSystemDefinitionImpl.java:27)
    at com.intellij.lang.jsgraphql.psi.impl.GraphQLTypeDefinitionImpl.accept(GraphQLTypeDefinitionImpl.java:27)
    at com.intellij.lang.jsgraphql.psi.impl.GraphQLObjectTypeDefinitionImpl.accept(GraphQLObjectTypeDefinitionImpl.java:27)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$10(InspectionRunner.java:323)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$11(InspectionRunner.java:331)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:229)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:187)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$12(InspectionRunner.java:337)
    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:300)
    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:300)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.lambda$call$0(JobLauncherImpl.java:299)
    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:60)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:284)
    at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:272)
    at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428)
    ... 5 more