jasmine / IdeaJasmine

12 stars 5 forks source link

Exception on deprecated getId in Webstorm 2021.3 #18

Closed marty30 closed 2 years ago

marty30 commented 2 years ago

After upgrading Webstorm to the latest version (2021.3) I keep getting this error:

com.intellij.diagnostic.PluginException: The default implementation of method 'getId' is deprecated, you need to override it in 'class io.pivotal.intellij.jasmine.JasmineConfigurationType$1'. The default implementation delegates to 'getName' which may be localized, but return value of this method must not depend on current localization. [Plugin: io.pivotal.jasmine]
    at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:270)
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:83)
    at com.intellij.diagnostic.PluginException.reportDeprecatedDefault(PluginException.java:110)
    at com.intellij.execution.configurations.ConfigurationFactory.getId(ConfigurationFactory.java:75)
    at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.writeExternal(RunnerAndConfigurationSettingsImpl.kt:267)
    at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.writeScheme(RunnerAndConfigurationSettingsImpl.kt:323)
    at com.intellij.configurationStore.LazySchemeProcessor.writeScheme(scheme-impl.kt:65)
    at com.intellij.execution.impl.RunConfigurationSchemeManager.writeScheme(RunConfigurationSchemeManager.kt:121)
    at com.intellij.execution.impl.RunConfigurationSchemeManager.writeScheme(RunConfigurationSchemeManager.kt:21)
    at com.intellij.configurationStore.schemeManager.SchemeManagerImpl.saveScheme(SchemeManagerImpl.kt:395)
    at com.intellij.configurationStore.schemeManager.SchemeManagerImpl.save(SchemeManagerImpl.kt:335)
    at com.intellij.configurationStore.Scheme_implKt.save(scheme-impl.kt:164)
    at com.intellij.execution.impl.RunManagerImpl.getState(RunManagerImpl.kt:625)
    at com.intellij.execution.impl.RunManagerImpl.getState(RunManagerImpl.kt:69)
    at com.intellij.configurationStore.ComponentStoreImpl.commitComponent(ComponentStoreImpl.kt:324)
    at com.intellij.configurationStore.ComponentStoreImpl.commitComponents$intellij_platform_configurationStore_impl(ComponentStoreImpl.kt:230)
    at com.intellij.configurationStore.ComponentStoreWithExtraComponents.commitComponents$intellij_platform_configurationStore_impl(ComponentStoreWithExtraComponents.kt:95)
    at com.intellij.configurationStore.ComponentStoreImpl$commitComponentsOnEdt$$inlined$withEdtContext$intellij_platform_configurationStore_impl$1.invokeSuspend(ComponentStoreImpl.kt:719)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at com.intellij.openapi.application.constraints.BaseConstrainedExecution$Companion$scheduleWithinConstraints$1.invoke(BaseConstrainedExecution.kt:68)
    at com.intellij.openapi.application.constraints.BaseConstrainedExecution$Companion.scheduleWithinConstraints(BaseConstrainedExecution.kt:71)
    at com.intellij.openapi.application.constraints.BaseConstrainedExecution.scheduleWithinConstraints(BaseConstrainedExecution.kt:38)
    at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl.access$scheduleWithinConstraints$s1153900543(BaseExpirableExecutorMixinImpl.kt:12)
    at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl$scheduleWithinConstraints$$inlined$Runnable$1.run(Runnable.kt:19)
    at com.intellij.openapi.application.impl.AppUIExecutorImpl$MyEdtExecutor.execute(AppUIExecutorImpl.kt:72)
    at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl.scheduleWithinConstraints(BaseExpirableExecutorMixinImpl.kt:23)
    at com.intellij.openapi.application.constraints.ConstrainedCoroutineDispatcherImpl.dispatch(ConstrainedCoroutineDispatcher.kt:34)
    at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:322)
    at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
    at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:170)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.configurationStore.ComponentStoreImpl.commitComponentsOnEdt$intellij_platform_configurationStore_impl(ComponentStoreImpl.kt:728)
    at com.intellij.configurationStore.ComponentStoreWithExtraComponents.saveSettingsSavingComponentsAndCommitComponents$intellij_platform_configurationStore_impl(ComponentStoreWithExtraComponents.kt:86)
    at com.intellij.configurationStore.ComponentStoreWithExtraComponents$saveSettingsSavingComponentsAndCommitComponents$1.invokeSuspend(ComponentStoreWithExtraComponents.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at com.intellij.configurationStore.StoreUtil$Companion.saveSettings(storeUtil.kt:49)
    at com.intellij.configurationStore.StoreUtil$Companion.saveSettings$default(storeUtil.kt:47)
    at com.intellij.configurationStore.StoreUtil$Companion.saveDocumentsAndProjectSettings(storeUtil.kt:63)
    at com.intellij.configurationStore.StoreUtil.saveDocumentsAndProjectSettings(storeUtil.kt)
    at com.intellij.openapi.vcs.update.AbstractCommonUpdateAction.actionPerformed(AbstractCommonUpdateAction.java:112)
    at com.intellij.openapi.vcs.actions.AbstractVcsAction.actionPerformed(AbstractVcsAction.java:40)
    at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:172)
    at com.intellij.openapi.actionSystem.impl.ActionButton.lambda$performAction$0(ActionButton.java:151)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:265)
    at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:151)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:433)
    at java.desktop/java.awt.Component.processEvent(Component.java:6419)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
sgravrock commented 2 years ago

Thanks for the heads up. I see that the Jasmine plugin still works (for now) but this error pops up every time a project that uses it is opened. This is on my to-do list. In the meantime, I'd be happy to review a pull request that fixes the problem.

gap777 commented 2 years ago

@sgravrock This plugin is an answered prayer.. thank you!

Re: this issue... maybe I can help... can you outline the fix?

slackersoft commented 2 years ago

Based on the deprecation message, we probably need to implement our own getId to return a constant like "IdeaJasmine" or something similar.

el-dot commented 2 years ago

JavaDoc says:

Returns the id of the run configuration that is used for serialization. For compatibility reason the default implementation calls the method getName instead of myType.getId(). New implementations need to call myType.getId() by default.

Based on that I've implemented the method in linked PR #19

sgravrock commented 2 years ago

I went ahead and merged the attached PR, since it follows the documentation and appears to work in IntelliJ. I haven't been able to test it in WebStorm though. Either the docs on how to do that are wrong, or more likely we need to upgrade to a newer version of the Gradle plugin before that's possible.

gap777 commented 2 years ago

How do I get access to the change? Do you need to upgrade the version identifier of this plugin? Or push a new version to repositories used by RubyMine/IDEA?

slackersoft commented 2 years ago

Updates have been uploaded to JetBrains, awaiting review there for the most recent fixed. Version 1.6 should be available already, and version 1.8 should be available soon.