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

Slow operations prohibited on EDT exceptions with IntelliJ IDEA 2021.2.4 and later #2424

Open
anssit opened this issue Jan 10, 2022 · 2 comments
Assignees

Comments

@anssit
Copy link
Contributor

anssit commented Jan 10, 2022

Steps to reproduce

Open a V10+ design in IntelliJ IDEA Ultimate 2021.2.4 and later.

Actual behavior

IntelliJ IDEA pops up "IDE error occurred" notifications about "Slow operations prohibited on EDT" such as

java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
	at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:102)
	at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:784)
	at com.intellij.psi.stubs.StubIndexImpl.getContainingIds(StubIndexImpl.java:514)
	at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:318)
	at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:100)
	at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:88)
	at com.intellij.psi.impl.java.stubs.index.JavaAnnotationIndex.get(JavaAnnotationIndex.java:30)

Expected behavior

No such exceptions

IDE, Designer and OS version

IntelliJ IDEA 2021.2.4 and later, Designer 4.6.12, any OS

@anssit
Copy link
Contributor Author

anssit commented Jan 10, 2022

Notice that these exceptions do not block the use of Designer.

@anssit
Copy link
Contributor Author

anssit commented Jan 12, 2022

See SlowOperations.assertSlowOperationsAreAllowed. The purpose of these exceptions is apparently to make plugin developers aware of the potentially slow operations they are performing in the event thread and make them perform the operations in background tasks instead. However, such changes are easily non-trivial, and take some time to get implemented.

Meanwhile, if the exceptions get annoying, those can be disabled: "The notification can be disabled at Help | Find Action | Registry | ide.slow.operations.assertion." (source).

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

No branches or pull requests

1 participant