Skip to content

Commit

Permalink
remove duplicate code #66
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Mar 7, 2016
1 parent ea05331 commit 4dbd656
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 1 addition & 8 deletions src/main/java/com/alibaba/ttl/TtlCallable.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,7 @@ public static <T> List<TtlCallable<T>> gets(Collection<? extends Callable<T>> ta
* @return Wrapped {@link Callable}
*/
public static <T> List<TtlCallable<T>> gets(Collection<? extends Callable<T>> tasks, boolean releaseTtlValueReferenceAfterCall) {
if (null == tasks) {
return Collections.emptyList();
}
List<TtlCallable<T>> copy = new ArrayList<TtlCallable<T>>();
for (Callable<T> task : tasks) {
copy.add(TtlCallable.get(task, releaseTtlValueReferenceAfterCall, false));
}
return copy;
return gets(tasks, releaseTtlValueReferenceAfterCall, false);
}

/**
Expand Down
9 changes: 1 addition & 8 deletions src/main/java/com/alibaba/ttl/TtlRunnable.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,7 @@ public static List<TtlRunnable> gets(Collection<? extends Runnable> tasks) {
* @throws IllegalStateException when input is {@link TtlRunnable} already.
*/
public static List<TtlRunnable> gets(Collection<? extends Runnable> tasks, boolean releaseTtlValueReferenceAfterRun) {
if (null == tasks) {
return Collections.emptyList();
}
List<TtlRunnable> copy = new ArrayList<TtlRunnable>();
for (Runnable task : tasks) {
copy.add(TtlRunnable.get(task, releaseTtlValueReferenceAfterRun, false));
}
return copy;
return gets(tasks, releaseTtlValueReferenceAfterRun, false);
}

/**
Expand Down

0 comments on commit 4dbd656

Please sign in to comment.