Skip to content

Commit

Permalink
Code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Jun 7, 2021
1 parent 7670229 commit 644213b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

/**
* {@link AgentListener} can be used to execute code before/after Java agent installation, for
* example to install any implementation providers that are used by * instrumentations. For
* instance, this project uses this SPI to install OpenTelemetry SDK.
* example to install any implementation providers that are used by instrumentations. For instance,
* this project uses this SPI to install OpenTelemetry SDK.
*
* <p>This is a service provider interface that requires implementations to be registered in a
* provider-configuration file stored in the {@code META-INF/services} resource directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.ServiceLoader;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -48,9 +47,9 @@ public static <T> List<T> load(Class<T> serviceClass) {
* {@link Ordered#order()}.
*/
public static <T extends Ordered> List<T> loadOrdered(Class<T> serviceClass) {
return load(serviceClass).stream()
.sorted(Comparator.comparingInt(Ordered::order))
.collect(Collectors.toList());
List<T> impls = load(serviceClass);
impls.sort(Comparator.comparing(Ordered::order));
return impls;
}

private SafeServiceLoader() {}
Expand Down

0 comments on commit 644213b

Please sign in to comment.