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

[infinitest-intellij] NullPointerException in applyInformationWithProgress() in Idea 2017.2 #233

Closed
szpak opened this issue Jul 13, 2017 · 7 comments · Fixed by #304
Closed
Labels
comp:infinitest-intellij Issues related to Infintest for IntelliJ (and other Jetbrains IDEs) type: bug

Comments

@szpak
Copy link
Contributor

szpak commented Jul 13, 2017

Occasionally I observe the following exception using Infinitest plugin 5.1.116 with Intelluj Idea Community 2017.2 (build 172.3317.53). In general the plugin seems to work fine.

Caused by: java.lang.NullPointerException
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass
             .applyInformationWithProgress(GeneralHighlightingPass.java:272)

I haven't seen that in the previous version, but I was using older patched version due to #192, so it might not be affected.

The full stacktrace:

java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:150)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:821)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:649)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:144)
	... 17 more
Caused by: java.lang.NullPointerException
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.applyInformationWithProgress(GeneralHighlightingPass.java:272)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doApplyInformationToEditor(ProgressableTextEditorHighlightingPass.java:97)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.applyInformationToEditor(TextEditorHighlightingPass.java:115)
	at org.infinitest.intellij.plugin.launcher.FileEditorListener.testRunCompleted(FileEditorListener.java:44)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.onComplete(InfinitestPresenter.java:191)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.testRunComplete(InfinitestPresenter.java:162)
	... 22 more
@oshoukry
Copy link

This is still happening with updated builds. I can't pin point the exact trigger that causes it to throw this error, but it appears to be happening while watching for changes. Doesn't appear to block running of the tests though.

Setup Details:

IDE: IntelliJ IDEA 2017.3.4 (Ultimate Edition) - Build #IU-173.4548.28, built on January 29, 2018
JVM Version: JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o - JRE: 1.8.0_152-release-1024-b11 x86_64
Infinitest Version: 5.0.1.116
Operating System: macOS High Sierra 10.13.3

Exception Stacktrace:

java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:150)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.j(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor594.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:144)
	... 17 more
Caused by: java.lang.NullPointerException
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.applyInformationWithProgress(GeneralHighlightingPass.java:274)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doApplyInformationToEditor(ProgressableTextEditorHighlightingPass.java:97)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.applyInformationToEditor(TextEditorHighlightingPass.java:115)
	at org.infinitest.intellij.plugin.launcher.FileEditorListener.testRunCompleted(FileEditorListener.java:44)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.onComplete(InfinitestPresenter.java:191)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.testRunComplete(InfinitestPresenter.java:162)
	... 21 more

@sarod sarod added comp:infinitest-intellij Issues related to Infintest for IntelliJ (and other Jetbrains IDEs) type: bug labels May 9, 2018
@sarod sarod changed the title NullPointerException in applyInformationWithProgress() in Idea 2017.2 [infinitest-intellij] NullPointerException in applyInformationWithProgress() in Idea 2017.2 May 15, 2018
@szpak
Copy link
Contributor Author

szpak commented Dec 8, 2018

I spotted that the problem occurs only if I have more than one open idea windows (and working on "the second one"). I haven't encountered that error with just one Idea window. Probably the plugin doesn't take into account information about the current window.

Still occurs (with 2+ windows) with IC- 2018.3.1 and Infinitest 5.2.0.

@mhaberl
Copy link

mhaberl commented Apr 26, 2019

@szpak just FYI; it happens if you have open any jetbrains tool as the second window (which, in some cases, does not have infinitest plugin) e.g. WebStorm

@mhaberl
Copy link

mhaberl commented Apr 30, 2019

@szpak it also happens if you have only one IDE open:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:150)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:741)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:690)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:385)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:144)
	... 17 more
Caused by: java.lang.NullPointerException
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.applyInformationWithProgress(GeneralHighlightingPass.java:256)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doApplyInformationToEditor(ProgressableTextEditorHighlightingPass.java:98)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.applyInformationToEditor(TextEditorHighlightingPass.java:114)
	at org.infinitest.intellij.plugin.launcher.FileEditorListener.testRunCompleted(FileEditorListener.java:44)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.onComplete(InfinitestPresenter.java:191)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.testRunComplete(InfinitestPresenter.java:162)
	... 22 more

@szpak
Copy link
Contributor Author

szpak commented Apr 30, 2019

Hmm, strange. Do you have a balloon visible in that case or the notifications are completely broken?
Which Idea/WebStorm?

@mhaberl
Copy link

mhaberl commented May 6, 2019

@szpak
The notification balloon is visible and working.
It happened now for a few days in a row with only 1 IntelliJ open.

This is the IDE version info:

IntelliJ IDEA 2019.1.1 (Ultimate Edition)
Build #IU-191.6707.61, built on April 16, 2019

JRE: 1.8.0_202-release-1483-b44 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-48-generic

@gtoison
Copy link
Contributor

gtoison commented Aug 1, 2022

I got a similar error with IDEA 2022.2 (only one window open)
They seem to have updated the error message and now it says what might be the actual problem

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:150)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
	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:749)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
	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)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.infinitest.EventNormalizer$1$1.run(EventNormalizer.java:144)
	... 23 more
Caused by: java.lang.IllegalStateException: Must not instantiate passes in EDT
	at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPassRegistrarImpl.instantiatePasses(TextEditorHighlightingPassRegistrarImpl.java:168)
	at com.intellij.codeInsight.daemon.impl.TextEditorBackgroundHighlighter.getPasses(TextEditorBackgroundHighlighter.java:75)
	at com.intellij.codeInsight.daemon.impl.TextEditorBackgroundHighlighter.createPassesForEditor(TextEditorBackgroundHighlighter.java:80)
	at com.intellij.codeInsight.daemon.impl.TextEditorBackgroundHighlighter.createPassesForEditor(TextEditorBackgroundHighlighter.java:24)
	at org.infinitest.intellij.plugin.launcher.FileEditorListener.testRunCompleted(FileEditorListener.java:43)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.onComplete(InfinitestPresenter.java:191)
	at org.infinitest.intellij.plugin.launcher.InfinitestPresenter.testRunComplete(InfinitestPresenter.java:162)
	... 28 more

gtoison added a commit to erroraway/infinitest that referenced this issue Aug 2, 2022
Store the pass in the editor instead of calling
fileEditor.getBackgroundHighlighter().createPassesForEditor(), that
method recreates the passes and must not be called from the EDT while
highlightingPass.applyInformationToEditor() must be called from the EDT.

fixes infinitest#233
fixes infinitest#274
gtoison added a commit that referenced this issue Aug 3, 2022
Store the pass in the editor instead of calling fileEditor.getBackgroundHighlighter().createPassesForEditor(), that method recreates the passes and must not be called from the EDT while highlightingPass.applyInformationToEditor() must be called from the EDT.

fixes #233
fixes #274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:infinitest-intellij Issues related to Infintest for IntelliJ (and other Jetbrains IDEs) type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants