#70 - Polishing.
Fix logger warning calls. Replace lambdas with method references.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user