Skip to content

Commit

Permalink
Review fixes (#520)
Browse files Browse the repository at this point in the history
* Fix module names.
* Fix (and simplify) wrapTasks method.

---------

Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
  • Loading branch information
sjoerdtalsma authored Nov 15, 2024
1 parent 71277c9 commit d8f77d5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -74,18 +73,14 @@ protected <T> Future<T> wrap(Future<T> source) {
* @see #wrap(Callable)
*/
protected <T> Collection<? extends Callable<T>> wrapTasks(Collection<? extends Callable<T>> tasks) {
Collection<? extends Callable<T>> wrappedTasks = tasks;
if (tasks != null && !tasks.isEmpty()) {
boolean modification = false;
final List<Callable<T>> copy = new ArrayList<Callable<T>>(tasks.size());
final List<Callable<T>> wrappedTasks = new ArrayList<>(tasks.size());
for (Callable<T> task : tasks) {
final Callable<T> wrapped = wrap(task);
modification |= (task == wrapped || Objects.equals(task, wrapped));
copy.add(wrapped);
wrappedTasks.add(wrap(task));
}
if (modification) wrappedTasks = copy;
tasks = wrappedTasks;
}
return wrappedTasks;
return tasks;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion timers/context-timer-micrometer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<packaging>jar</packaging>

<properties>
<project.moduleName>${project.groupId}.metrics</project.moduleName>
<project.moduleName>${project.groupId}.micrometer</project.moduleName>
<root.basedir>${project.parent.basedir}</root.basedir>

<micrometer.version>1.14.0</micrometer.version>
Expand Down
2 changes: 1 addition & 1 deletion timers/context-timer-opentelemetry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<packaging>jar</packaging>

<properties>
<project.moduleName>${project.groupId}.metrics</project.moduleName>
<project.moduleName>${project.groupId}.opentelemetry</project.moduleName>
<root.basedir>${project.parent.basedir}</root.basedir>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion timers/context-timer-opentracing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<packaging>jar</packaging>

<properties>
<project.moduleName>${project.groupId}.metrics</project.moduleName>
<project.moduleName>${project.groupId}.opentracing</project.moduleName>
<root.basedir>${project.parent.basedir}</root.basedir>
</properties>

Expand Down

0 comments on commit d8f77d5

Please sign in to comment.