// Class may not be loaded yet
logger.log(Level.SEVERE, "Error while finding " + method.getDeclaringClass() + " as a service");
return null;
}
Object instance = service.get();
Command ann = method.getAnnotation(Command.class);
List<Predicate<UIContext>> enabledPredicates = new ArrayList<>();
for (Class<? extends Predicate<UIContext>> type : ann.enabled())
{
enabledPredicates.add(registry.getServices(type).get());
}
return new AnnotationCommandAdapter(method, instance, factory, enabledPredicates);
}