diff --git a/src/main/java/com/alibaba/ttl/TtlCallable.java b/src/main/java/com/alibaba/ttl/TtlCallable.java index f7f335eb1..e8a5a90f1 100644 --- a/src/main/java/com/alibaba/ttl/TtlCallable.java +++ b/src/main/java/com/alibaba/ttl/TtlCallable.java @@ -128,14 +128,7 @@ public static List> gets(Collection> ta * @return Wrapped {@link Callable} */ public static List> gets(Collection> tasks, boolean releaseTtlValueReferenceAfterCall) { - if (null == tasks) { - return Collections.emptyList(); - } - List> copy = new ArrayList>(); - for (Callable task : tasks) { - copy.add(TtlCallable.get(task, releaseTtlValueReferenceAfterCall, false)); - } - return copy; + return gets(tasks, releaseTtlValueReferenceAfterCall, false); } /** diff --git a/src/main/java/com/alibaba/ttl/TtlRunnable.java b/src/main/java/com/alibaba/ttl/TtlRunnable.java index a16ec020b..263e0f3a5 100644 --- a/src/main/java/com/alibaba/ttl/TtlRunnable.java +++ b/src/main/java/com/alibaba/ttl/TtlRunnable.java @@ -132,14 +132,7 @@ public static List gets(Collection tasks) { * @throws IllegalStateException when input is {@link TtlRunnable} already. */ public static List gets(Collection tasks, boolean releaseTtlValueReferenceAfterRun) { - if (null == tasks) { - return Collections.emptyList(); - } - List copy = new ArrayList(); - for (Runnable task : tasks) { - copy.add(TtlRunnable.get(task, releaseTtlValueReferenceAfterRun, false)); - } - return copy; + return gets(tasks, releaseTtlValueReferenceAfterRun, false); } /**