FWDekker / intellij-randomness

IntelliJ plugin for inserting random numbers, UUIDs, names, IP addresses, and much more
https://plugins.jetbrains.com/plugin/9836-randomness
MIT License
45 stars 7 forks source link

Error in Intellij IDEA #465

Closed ghost closed 1 year ago

ghost commented 1 year ago

Additional info No additional information provided.

Stacktraces

Stacktrace 1/1

```java com.intellij.diagnostic.PluginException: 526 ms to call on BGT precache-slow-data@PopupActionupdate@keyboard shortcut (com.fwdekker.randomness.PopupAction). Revise AnAction.getActionUpdateThread property [Plugin: com.fwdekker.randomness] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23) at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89) at com.intellij.openapi.actionSystem.impl.ActionUpdater.logTimeProblemForPreCached(ActionUpdater.java:487) at com.intellij.openapi.actionSystem.impl.ActionUpdater.ensureSlowDataKeysPreCached(ActionUpdater.java:481) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$callAction$6(ActionUpdater.java:205) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102) at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:205) at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:165) at com.intellij.openapi.actionSystem.impl.ActionUpdater.updateActionReal(ActionUpdater.java:141) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$0(ActionUpdater.java:128) at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:711) at com.intellij.openapi.actionSystem.impl.ActionUpdater$UpdateSessionImpl.presentation(ActionUpdater.java:813) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.doUpdateActionsInner(IdeKeyEventDispatcher.java:675) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$3(IdeKeyEventDispatcher.java:622) at com.intellij.openapi.actionSystem.impl.Utils.lambda$runUpdateSessionForInputEvent$15(Utils.java:753) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$tryRunReadActionAndCancelBeforeWrite$19(ActionUpdater.java:425) at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:129) at com.intellij.openapi.actionSystem.impl.ActionUpdater.tryRunReadActionAndCancelBeforeWrite(ActionUpdater.java:421) at com.intellij.openapi.actionSystem.impl.Utils.lambda$runUpdateSessionForInputEvent$16(Utils.java:753) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.openapi.actionSystem.impl.Utils.lambda$runUpdateSessionForInputEvent$18(Utils.java:760) 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.openapi.actionSystem.impl.Utils.lambda$runUpdateSessionForInputEvent$20(Utils.java:759) at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:248) at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:28) at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:221) at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:227) at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833) ```

Version information

FWDekker commented 1 year ago

Hi Pompei, thank you for opening the issue! This appears to be a duplicate of #445.

I investigated the issue in more detail then: The exception is raised because IntelliJ thinks part of my plugin is too slow, but the part in question is verifiably not slow; it only does two variable assignments and one getter. The most likely reason for the exception is that IntelliJ was indexing while you were using Randomness. Therefore, I decided to consider this a false-positive exception generated by IntelliJ.

(That said, once Randomness stops supporting versions below 2022.3, this issue should not occur again, even during indexing, since these actions will all be moved to the EDT thread.)

I'll close the issue, but if you think the cause may be different, or if you have other comments, please let me know!