DBE-1754: associate versions with plugin id regardless of whether a plugin is bundled

ResourceVersions maps plugin ids to their versions. For bundled plugins, core plugin id was used.
Core plugin class loader doesn't have bundled plugin resources on it's classpath, when running on
 production jars.

 This led to a version being updated on attempt to run startup scripts, while no resources were
 extracted. Further checks on whether resources should be extracted were failing.
This commit is contained in:
Sergey Savenko
2015-11-05 15:42:20 +03:00
parent 3d873661bd
commit e3bfaeb257
@@ -100,8 +100,10 @@ class ResourceVersions implements PersistentStateComponent<ResourceVersions.Stat
return null;
}
@NotNull
private static String getId(@NotNull IdeaPluginDescriptor plugin) {
return plugin.isBundled() ? PluginManagerCore.CORE_PLUGIN_ID : plugin.getPluginId().getIdString();
PluginId pluginId = plugin.getPluginId();
return pluginId != null ? pluginId.getIdString() : PluginManagerCore.CORE_PLUGIN_ID;
}
@NotNull