Skip to content

Commit

Permalink
fix(sonar): Generic wildcard types should not be used in return types…
Browse files Browse the repository at this point in the history
… java:S1452
  • Loading branch information
halibobo1205 committed Jun 17, 2024
1 parent b2898ae commit c2bf297
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public abstract class AbstractService implements Service {


@Override
public CompletableFuture<?> start() {
public CompletableFuture<Boolean> start() {
logger.info("{} starting on {}", name, port);
final CompletableFuture<?> resultFuture = new CompletableFuture<>();
final CompletableFuture<Boolean> resultFuture = new CompletableFuture<>();
try {
innerStart();
resultFuture.complete(null);
resultFuture.complete(true);
logger.info("{} started, listening on {}", name, port);
} catch (Exception e) {
resultFuture.completeExceptionally(e);
Expand All @@ -32,12 +32,12 @@ public CompletableFuture<?> start() {
}

@Override
public CompletableFuture<?> stop() {
public CompletableFuture<Boolean> stop() {
logger.info("{} shutdown...", name);
final CompletableFuture<?> resultFuture = new CompletableFuture<>();
final CompletableFuture<Boolean> resultFuture = new CompletableFuture<>();
try {
innerStop();
resultFuture.complete(null);
resultFuture.complete(true);
logger.info("{} shutdown complete", name);
} catch (Exception e) {
resultFuture.completeExceptionally(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void innerStop() throws Exception {
}

@Override
public CompletableFuture<?> start() {
public CompletableFuture<Boolean> start() {
initServer();
ServletContextHandler context = initContextHandler();
addServlet(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void innerStop() throws Exception {
}

@Override
public CompletableFuture<?> start() {
public CompletableFuture<Boolean> start() {
NettyServerBuilder serverBuilder = initServerBuilder();
addService(serverBuilder);
addInterceptor(serverBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public interface Service {
*
* @return completion state
*/
CompletableFuture<?> start();
CompletableFuture<Boolean> start();

/**
* Stops the service and performs needed cleanup.
*
* @return completion state
*/
CompletableFuture<?> stop();
CompletableFuture<Boolean> stop();

boolean isEnable();

Expand Down

0 comments on commit c2bf297

Please sign in to comment.