Skip to content

Commit

Permalink
PAYARA-3125 Check instance class instead of impl class for @priority
Browse files Browse the repository at this point in the history
annotation
  • Loading branch information
Pandrex247 committed Oct 22, 2018
1 parent efa1cc2 commit ad9e68a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public static <T> Collection<ServiceHolder<T>> getAllServiceHolders(InjectionMan
contract,
Comparator.comparingInt(Providers::getPriority),
CustomAnnotationLiteral.INSTANCE);
providers.addAll(getServiceHolders(injectionManager, contract));
providers.addAll(getServiceHolders(injectionManager, contract, Comparator.comparingInt(Providers::getPriority)));

LinkedHashSet<ServiceHolder<T>> providersSet = new LinkedHashSet<>();
for (ServiceHolder<T> provider : providers) {
Expand All @@ -337,8 +337,8 @@ private static <T> List<ServiceHolder<T>> getServiceHolders(InjectionManager inj
Comparator<Class<?>> objectComparator,
Annotation... qualifiers) {

List<ServiceHolder<T>> serviceHolders = injectionManager.getAllServiceHolders(contract, qualifiers);
serviceHolders.sort((o1, o2) -> objectComparator.compare(o1.getImplementationClass(), o2.getImplementationClass()));
List<ServiceHolder<T>> serviceHolders = getServiceHolders(injectionManager, contract, qualifiers);
serviceHolders.sort((o1, o2) -> objectComparator.compare(o1.getInstance().getClass(), o2.getInstance().getClass()));
return serviceHolders;
}

Expand Down

0 comments on commit ad9e68a

Please sign in to comment.