Random error regarding Randomness after updating
LukasMFR opened this issue · comments
Additional info
I just got an issue in PyCharm telling me that an error occured with Randomness plugin, I just did an update of that plugin before getting this random issue.
The plugin appears to work fine though.
And PyCharm recommended to share issue so I do that.
Stacktraces
Stacktrace 1/1
com.intellij.diagnostic.PluginException: Cannot create class com.fwdekker.randomness.integer.IntegerSettingsConfigurable (classloader=PluginClassLoader(plugin=PluginDescriptor(name=Randomness, id=com.fwdekker.randomness, descriptorPath=plugin.xml, path=~\AppData\Roaming\JetBrains\PyCharmCE2021.2\plugins\intellij-randomness, version=2.7.2, package=null), packagePrefix=null, instanceId=3, state=active))
at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:870)
at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:887)
at com.intellij.openapi.options.ConfigurableEP$ClassProducer.createElement(ConfigurableEP.java:440)
at com.intellij.openapi.options.ConfigurableEP.createConfigurable(ConfigurableEP.java:346)
at com.intellij.openapi.options.ex.ConfigurableWrapper.createConfigurable(ConfigurableWrapper.java:42)
at com.intellij.openapi.options.ex.ConfigurableWrapper.getConfigurable(ConfigurableWrapper.java:116)
at com.intellij.openapi.options.ex.ConfigurableWrapper.cast(ConfigurableWrapper.java:91)
at com.intellij.openapi.options.ex.ConfigurableWrapper.getDisplayName(ConfigurableWrapper.java:137)
at com.intellij.ide.util.gotoByName.GotoActionModel.lambda$new$0(GotoActionModel.java:83)
at com.intellij.openapi.util.NotNullLazyValue$3.compute(NotNullLazyValue.java:99)
at com.intellij.openapi.util.NotNullLazyValue$3.getValue(NotNullLazyValue.java:84)
at com.intellij.ide.util.gotoByName.GotoActionModel.getConfigurablesNames(GotoActionModel.java:368)
at com.intellij.ide.util.gotoByName.GotoActionItemProvider.processOptions(GotoActionItemProvider.java:151)
at com.intellij.ide.util.gotoByName.GotoActionItemProvider.filterElements(GotoActionItemProvider.java:97)
at com.intellij.ide.actions.searcheverywhere.ActionSearchEverywhereContributor.fetchWeightedElements(ActionSearchEverywhereContributor.java:99)
at com.intellij.ide.actions.searcheverywhere.MixedResultsSearcher$ContributorSearchTask.run(MixedResultsSearcher.java:177)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
at com.intellij.util.ConcurrencyUtil.lambda$underThreadNameRunnable$3(ConcurrencyUtil.java:201)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:265)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassCastException: class com.fwdekker.randomness.integer.IntegerSettings cannot be cast to class com.fwdekker.randomness.integer.IntegerSettings (com.fwdekker.randomness.integer.IntegerSettings is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @7c1fab1f com.fwdekker.randomness.integer.IntegerSettings is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @5b077c18)
at com.fwdekker.randomness.integer.IntegerSettings$Companion.getDefault(IntegerSettings.kt:178)
at com.fwdekker.randomness.integer.IntegerSettingsComponent.<init>(IntegerSettingsComponent.kt:31)
at com.fwdekker.randomness.integer.IntegerSettingsConfigurable.<init>(IntegerSettings.kt:172)
at com.fwdekker.randomness.integer.IntegerSettingsConfigurable.<init>(IntegerSettings.kt)
at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:830)
... 27 moreVersion information
- Randomness version: 2.7.2
- IDE version: PC-212.5284.44
- Operating system: Windows 10
- Java version: 11.0.12
Hi Lukas! Thanks for reporting the bug. I noticed a similar bug when I updated the plugin myself. The bug appears only when you update the plugin using the update notification, and Randomness is then invoked (either explicitly or in the background) without restarting the IDE. After restarting the IDE the bug no longer occurs.
It looks like the bug is unrelated to Randomness itself, and I already reported the issue at JetBrains as IDEA-279700. I'll be keeping your issue open so that others can see it as well if they encounter this bug.
IntelliJ marked IDEA-279700 as fixed as of IntelliJ 2021.2.4. Indeed, in 2021.3 I can no longer reproduce the bug, so I'll close this issue. If you still encounter this bug, or have any other issues, please don't hesitate to let me know!