Skip to content

Commit

Permalink
Simplify PluginsUtils code
Browse files Browse the repository at this point in the history
  • Loading branch information
williamrandolph committed Oct 18, 2023
1 parent b3525d3 commit 861727b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions server/src/main/java/org/elasticsearch/plugins/PluginsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,9 @@ public static List<Path> findPluginDirs(final Path rootPath) throws IOException
* Verify the given plugin is compatible with the current Elasticsearch installation.
*/
public static void verifyCompatibility(PluginDescriptor info) {
boolean buildSupportsStablePlugins;
SemanticVersion currentElasticsearchVersion = null;
try {
currentElasticsearchVersion = SemanticVersion.create(Build.current().version());
buildSupportsStablePlugins = true;
} catch (IllegalArgumentException e) {
buildSupportsStablePlugins = false;
}
SemanticVersion currentElasticsearchVersion = SemanticVersion.create(Build.current().version());
// stable plugins can run on the exact version they're built with even if it's not semantic
if (info.isStable() && buildSupportsStablePlugins) {
if (info.isStable()) {
SemanticVersion pluginElasticsearchVersion;
try {
pluginElasticsearchVersion = SemanticVersion.create(info.getElasticsearchVersion());
Expand Down

0 comments on commit 861727b

Please sign in to comment.