Report correct plugin ID in unload failure messages from ActionManagerImpl

GitOrigin-RevId: 93bd9bb8f70f701a1e2c3bfa7a40b3d3c946b6a2
This commit is contained in:
Dmitry Jemerov
2020-06-02 21:35:39 +03:00
committed by intellij-monorepo-bot
parent b1a69b9b65
commit d9a6e42359
2 changed files with 3 additions and 3 deletions
@@ -223,7 +223,7 @@ object DynamicPlugins {
val pluginId = loadedPluginDescriptor?.pluginId ?: baseDescriptor?.pluginId
checkNoComponentsOrServiceOverrides(pluginId, descriptor)?.let { return it }
ActionManagerImpl.checkUnloadActions(descriptor)?.let { return it }
ActionManagerImpl.checkUnloadActions(pluginId, descriptor)?.let { return it }
descriptor.pluginDependencies?.forEach { dependency ->
if (isPluginOrModuleLoaded(dependency.id)) {
@@ -1113,7 +1113,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Disposab
}
@ApiStatus.Internal
public static @Nullable String checkUnloadActions(@NotNull IdeaPluginDescriptorImpl pluginDescriptor) {
public static @Nullable String checkUnloadActions(PluginId pluginId, @NotNull IdeaPluginDescriptorImpl pluginDescriptor) {
List<Element> elements = pluginDescriptor.getActionDescriptionElements();
if (elements == null) {
return null;
@@ -1122,7 +1122,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Disposab
if (!element.getName().equals(ACTION_ELEMENT_NAME) &&
!(element.getName().equals(GROUP_ELEMENT_NAME) && canUnloadGroup(element)) &&
!element.getName().equals(REFERENCE_ELEMENT_NAME)) {
return "Plugin " + pluginDescriptor.getPluginId() + " is not unload-safe because of action element " + element.getName();
return "Plugin " + pluginId + " is not unload-safe because of action element " + element.getName();
}
}
return null;