#70 - Polishing.

Fix logger warning calls. Replace lambdas with method references.
This commit is contained in:
Mark Paluch
2018-03-21 11:33:17 +01:00
parent 860f1841dc
commit 49b80f679b
3 changed files with 12 additions and 11 deletions

View File

@@ -603,7 +603,7 @@ public class GitOperations {
checkout(project, branch); checkout(project, branch);
} catch (RuntimeException o_O) { } catch (RuntimeException o_O) {
logger.log(project, "Couldn't check out branch %s. Skipping cherrypick of commit %s.", branch, id.getName()); logger.warn(project, "Couldn't check out branch %s. Skipping cherrypick of commit %s.", branch, id.getName());
return; return;
} }

View File

@@ -18,6 +18,7 @@ package org.springframework.data.release.utils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.Collection; import java.util.Collection;
import java.util.Objects;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collector; import java.util.stream.Collector;
@@ -55,7 +56,7 @@ public class ExecutionUtils {
log.error(o_O.getMessage(), o_O); log.error(o_O.getMessage(), o_O);
throw new RuntimeException(o_O); throw new RuntimeException(o_O);
} }
})).collect(Collectors.toList()).forEach(future -> future.join()); })).collect(Collectors.toList()).forEach(CompletableFuture::join);
} }
/** /**
@@ -78,10 +79,10 @@ public class ExecutionUtils {
return streamable.stream().// return streamable.stream().//
map(it -> CompletableFuture.supplyAsync(() -> function.apply(it))).// map(it -> CompletableFuture.supplyAsync(() -> function.apply(it))).//
filter(it -> it != null).// filter(Objects::nonNull).//
collect(Collectors.toList()).// collect(Collectors.toList()).//
stream().// stream().//
map(future -> future.join()).// map(CompletableFuture::join).//
collect(collector); collect(collector);
} }

View File

@@ -54,19 +54,19 @@ public class Logger {
} }
public void warn(ModuleIteration module, Object template, Object... args) { public void warn(ModuleIteration module, Object template, Object... args) {
log(module.getProject(), template, args); warn(module.getProject(), template, args);
} }
public void warn(Project project, Object template, Object... args) { public void warn(Project project, Object template, Object... args) {
log(project.getName(), template, args); warn(project.getName(), template, args);
} }
public void warn(TrainIteration iteration, Object template, Object... args) { public void warn(TrainIteration iteration, Object template, Object... args) {
log(iteration.toString(), template, args); warn(iteration.toString(), template, args);
} }
public void warn(Train train, Object template, Object... args) { public void warn(Train train, Object template, Object... args) {
log(train.getName(), template, args); warn(train.getName(), template, args);
} }
public void warn(String context, Object template, Object... args) { public void warn(String context, Object template, Object... args) {