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

NullPointerException from CMakeNotificationProviderWrapper #5247

Closed
ujohnny opened this issue Aug 15, 2023 · 1 comment
Closed

NullPointerException from CMakeNotificationProviderWrapper #5247

ujohnny opened this issue Aug 15, 2023 · 1 comment
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: CLion CLion plugin type: bug

Comments

@ujohnny
Copy link
Collaborator

ujohnny commented Aug 15, 2023

Description of the bug:

Sometimes CLion reports the following NPE

com.intellij.diagnostic.PluginException: Cannot invoke "java.util.function.Function.apply(Object)" because the return value of "com.jetbrains.cidr.cpp.cmake.workspace.CMakeNotificationProvider.collectNotificationData(com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile)" is null [Plugin: com.google.idea.bazel.clwb]
	at com.intellij.ui.EditorNotificationsImpl$updateEditors$job$1.invokeSuspend(EditorNotificationsImpl.kt:226)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.function.Function.apply(Object)" because the return value of "com.jetbrains.cidr.cpp.cmake.workspace.CMakeNotificationProvider.collectNotificationData(com.intellij.openapi.project.Project, com.intellij.openapi.vfs.VirtualFile)" is null
	at com.google.idea.sdkcompat.cpp.CMakeNotificationProviderWrapper.createNotificationPanel(CMakeNotificationProviderWrapper.java:20)
	at com.google.idea.blaze.plugin.CMakeNotificationFilter.createNotificationPanel(CMakeNotificationFilter.java:55)
	at com.intellij.ui.EditorNotifications$Provider.lambda$collectNotificationData$0(EditorNotifications.java:60)
	at com.intellij.ui.EditorNotificationsImpl$updateEditors$job$1$2.invokeSuspend(EditorNotificationsImpl.kt:218)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:193)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:789)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:740)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:734)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:759)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:589)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Unclear. Though this is a pure coding error and even static analysis highlights it.

Which Intellij IDE are you using? Please provide the specific version.

CL-232.8660.186

What programming languages and tools are you using? Please provide specific versions.

No response

What Bazel plugin version are you using?

2023.08.01.0.1-api-version-232

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@ujohnny ujohnny added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Aug 15, 2023
@ujohnny
Copy link
Collaborator Author

ujohnny commented Aug 15, 2023

I'll fix this issue. The fix is pretty straightforward.

@sgowroji sgowroji added the product: CLion CLion plugin label Aug 15, 2023
ujohnny added a commit to ujohnny/intellij that referenced this issue Aug 15, 2023
method is declared as @nullable in CLion SDK
though sdkcompat ignores this hint. fixes bazelbuild#5247.
ujohnny added a commit to ujohnny/intellij that referenced this issue Aug 15, 2023
method is declared as @nullable in CLion SDK
though sdkcompat ignores this hint. fixes bazelbuild#5247.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: CLion CLion plugin type: bug
Projects
Development

No branches or pull requests

5 participants