Migration Mappings Detection

Still having issues with source locations, would need to check it out first

Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
shedaniel
2021-05-08 12:50:17 +08:00
parent d91d7c096c
commit 3f576a44ab
10 changed files with 345 additions and 49 deletions

View File

@@ -40,6 +40,12 @@ import java.util.stream.Collectors;
import com.google.common.base.Stopwatch;
public class ThreadingUtils {
public static <T> void run(T[] values, UnsafeConsumer<T> action) {
run(Arrays.stream(values)
.<UnsafeRunnable>map(t -> () -> action.accept(t))
.collect(Collectors.toList()));
}
public static <T> void run(Collection<T> values, UnsafeConsumer<T> action) {
run(values.stream()
.<UnsafeRunnable>map(t -> () -> action.accept(t))