Skip to content

Commit

Permalink
fix sonar bug
Browse files Browse the repository at this point in the history
  • Loading branch information
renanfranca committed May 8, 2024
1 parent eaf3015 commit 41e10b8
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder;
import tech.jhipster.lite.module.domain.replacement.ContentReplacer;
import tech.jhipster.lite.module.domain.replacement.ContentReplacers;
import tech.jhipster.lite.module.domain.startupcommand.DockerComposeStartupCommandLine;
import tech.jhipster.lite.module.domain.startupcommand.GradleStartupCommandLine;
import tech.jhipster.lite.module.domain.startupcommand.JHipsterStartupCommand;
import tech.jhipster.lite.module.domain.startupcommand.JHipsterStartupCommands;
import tech.jhipster.lite.module.domain.startupcommand.MavenStartupCommandLine;
import tech.jhipster.lite.module.domain.startupcommand.*;
import tech.jhipster.lite.shared.error.domain.Assert;

@SuppressWarnings("java:S6539")
Expand Down Expand Up @@ -137,15 +133,11 @@ private JHipsterTemplatedFiles buildTemplatedFiles(JHipsterModule module) {
}

private JHipsterStartupCommands buildStartupCommands(JHipsterModule module) {
if (detectedJavaBuildTool(module).isEmpty()) {
Optional<JavaBuildTool> javaBuildTool = detectedJavaBuildTool(module);
if (javaBuildTool.isEmpty()) {
return module.startupCommands();
}
var filteredCommands = module
.startupCommands()
.get()
.stream()
.filter(isStartupCommandCompatibleWith(detectedJavaBuildTool(module).get()))
.toList();
var filteredCommands = module.startupCommands().get().stream().filter(isStartupCommandCompatibleWith(javaBuildTool.get())).toList();
return new JHipsterStartupCommands(filteredCommands);
}

Expand Down

0 comments on commit 41e10b8

Please sign in to comment.