Skip to content

More annotation-api tweaks #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions inject/src/main/java/io/avaje/inject/spi/DBeanContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ public <T> List<T> sortByPriority(List<T> list) {

@Override
public <T> List<T> sortByPriority(List<T> list, final Class<? extends Annotation> priorityAnnotation) {
if (priorityAnnotation == null) {
// priority annotation not on the classpath
return list;
}
boolean priorityUsed = false;
List<SortBean<T>> tempList = new ArrayList<>(list.size());
for (T bean : list) {
Expand Down Expand Up @@ -250,7 +246,7 @@ private static class SortBean<T> implements Comparable<SortBean<T>> {
int initPriority(Class<? extends Annotation> priorityAnnotation) {
// Avoid adding hard dependency on javax.annotation-api by using reflection
try {
Annotation ann = bean.getClass().getAnnotation(priorityAnnotation);
Annotation ann = bean.getClass().getDeclaredAnnotation(priorityAnnotation);
if (ann != null) {
int priority = (Integer) priorityAnnotation.getMethod("value").invoke(ann);
priorityDefined = true;
Expand Down