Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,16 @@ public List<Plugin> findPluginsToDownload(Map<String, Plugin> requestedPlugins)
String pluginName = requestedPlugin.getKey();
Plugin plugin = requestedPlugin.getValue();
VersionNumber installedVersion = null;
if (installedPluginVersions.containsKey(pluginName)) {
installedVersion = installedPluginVersions.get(pluginName).getVersion();
} else if (bundledPluginVersions.containsKey(pluginName)) {
installedVersion = bundledPluginVersions.get(pluginName).getVersion();
} else if (bundledPluginVersions.containsKey(pluginName) &&
if (bundledPluginVersions.containsKey(pluginName) &&
installedPluginVersions.containsKey(pluginName)) {
installedVersion = bundledPluginVersions.get(pluginName).getVersion().
isNewerThan(installedPluginVersions.get(pluginName).getVersion()) ?
bundledPluginVersions.get(pluginName).getVersion() :
installedPluginVersions.get(pluginName).getVersion();
} else if (installedPluginVersions.containsKey(pluginName)) {
installedVersion = installedPluginVersions.get(pluginName).getVersion();
} else if (bundledPluginVersions.containsKey(pluginName)) {
installedVersion = bundledPluginVersions.get(pluginName).getVersion();
}
if (installedVersion == null) {
logVerbose(String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,10 @@ public void findPluginsToDownloadTest() {

installedPlugins.put("git", new Plugin("git", "1.1.1", null, null));
installedPlugins.put("git-client", new Plugin("git-client","2.7.5", null, null));
installedPlugins.put("ssh-credentials", new Plugin("structs", "1.12", null, null));

bundledPlugins.put("structs", new Plugin("structs", "1.16", null, null));
bundledPlugins.put("ssh-credentials", new Plugin("structs", "1.14", null, null));

pm.setInstalledPluginVersions(installedPlugins);
pm.setBundledPluginVersions(bundledPlugins);
Expand All @@ -877,8 +879,7 @@ public void findPluginsToDownloadTest() {
assertThat(actualPlugins)
.containsExactlyInAnyOrder(
new Plugin("credentials", "2.1.14", null, null),
new Plugin("structs", "1.18", null, null),
new Plugin("ssh-credentials", "1.13", null, null));
new Plugin("structs", "1.18", null, null));
}

@Test
Expand Down