From 6730f26ba27c13aa127e923ab74f4b80c8a94d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Mino?= Date: Sat, 20 Jan 2024 14:38:49 +0100 Subject: [PATCH] Simplify code --- .../domain/mavenplugin/JHipsterModuleMavenPlugins.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java b/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java index e32f2bc6f81..5c50830d4ad 100644 --- a/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java +++ b/src/main/java/tech/jhipster/lite/module/domain/mavenplugin/JHipsterModuleMavenPlugins.java @@ -79,12 +79,8 @@ private static Function toAddMavenPlu .stream() .flatMap(toDependencyVersion(versions, projectDependencies)) .forEach(commandBuilder::addDependencyVersion); - return plugin - .versionSlug() - .map(versions::get) - .map(commandBuilder::pluginVersion) - .map(AddMavenPluginOptionalBuilder::build) - .orElse(commandBuilder.build()); + plugin.versionSlug().map(versions::get).ifPresent(commandBuilder::pluginVersion); + return commandBuilder.build(); }; }