Skip to content

Commit 9efd648

Browse files
authored
Merge pull request #77 from norrisjeremy/more-annotation-api-tweaks
More annotation-api tweaks
2 parents 634b32b + 47f4d96 commit 9efd648

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

inject/src/main/java/io/avaje/inject/spi/DBeanContext.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ public <T> List<T> sortByPriority(List<T> list) {
106106

107107
@Override
108108
public <T> List<T> sortByPriority(List<T> list, final Class<? extends Annotation> priorityAnnotation) {
109-
if (priorityAnnotation == null) {
110-
// priority annotation not on the classpath
111-
return list;
112-
}
113109
boolean priorityUsed = false;
114110
List<SortBean<T>> tempList = new ArrayList<>(list.size());
115111
for (T bean : list) {
@@ -250,7 +246,7 @@ private static class SortBean<T> implements Comparable<SortBean<T>> {
250246
int initPriority(Class<? extends Annotation> priorityAnnotation) {
251247
// Avoid adding hard dependency on javax.annotation-api by using reflection
252248
try {
253-
Annotation ann = bean.getClass().getAnnotation(priorityAnnotation);
249+
Annotation ann = bean.getClass().getDeclaredAnnotation(priorityAnnotation);
254250
if (ann != null) {
255251
int priority = (Integer) priorityAnnotation.getMethod("value").invoke(ann);
256252
priorityDefined = true;

0 commit comments

Comments
 (0)