Skip to content

Commit

Permalink
Simplified annotation check code
Browse files Browse the repository at this point in the history
  • Loading branch information
hypfvieh committed Mar 12, 2024
1 parent 4362e22 commit b2fdd8a
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,11 @@ protected Set<Class<?>> getDBusInterfaces(Class<?> _inputClazz) {
result.add(clazz);
}

if (!checked.contains(Properties.class)) {
for (Method method : clazz.getDeclaredMethods()) {
DBusBoundProperty propertyAnnot = method.getAnnotation(DBusBoundProperty.class);
if (propertyAnnot != null) {
// clazz is using @DBusBoundProperty, always exposed the properties interface
toCheck.add(Properties.class);
break;
}
}
}
// if clazz is using @DBusBoundProperty, always expose the Properties interface
Arrays.stream(clazz.getDeclaredMethods())
.filter(method -> method.isAnnotationPresent(DBusBoundProperty.class))
.findAny()
.ifPresent(x -> toCheck.add(Properties.class));

// iterate over the sub-interfaces and select the ones that extend DBusInterface
// this is required especially for nested interfaces
Expand Down

0 comments on commit b2fdd8a

Please sign in to comment.