From b13db82be2b767a7d1c3ad88db6078c41cc59844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 14 Sep 2015 08:44:27 +0200 Subject: [PATCH] Component registration info - Dependencies from all parents --- src/main/java/info/ebenoit/ebul/cmp/NewComponentInfo.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/info/ebenoit/ebul/cmp/NewComponentInfo.java b/src/main/java/info/ebenoit/ebul/cmp/NewComponentInfo.java index ca411c3..3792167 100644 --- a/src/main/java/info/ebenoit/ebul/cmp/NewComponentInfo.java +++ b/src/main/java/info/ebenoit/ebul/cmp/NewComponentInfo.java @@ -13,6 +13,7 @@ import java.util.HashSet; import info.ebenoit.ebul.func.ThrowingBiConsumer; import info.ebenoit.ebul.func.ThrowingConsumer; import info.ebenoit.ebul.func.ThrowingSupplier; +import info.ebenoit.ebul.reflection.Annotations; import info.ebenoit.ebul.reflection.MemberFinder; @@ -74,8 +75,8 @@ public final class NewComponentInfo< T > } // Explicit dependencies - final Dependencies dependencies = klass.getAnnotation( Dependencies.class ); - if ( dependencies != null ) { + for ( Class< ? super T > c : Annotations.findParentsWith( klass , Dependencies.class ) ) { + final Dependencies dependencies = c.getDeclaredAnnotation( Dependencies.class ); for ( final String dependency : dependencies.value( ) ) { info.addDependency( dependency ); }