File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
lib/src/main/java/ch/akuhn/fame Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ private void acceptClass(MetaDescription metaDescription) throws IOException {
340340 }
341341 // Properties from my traits that are not in my own properties
342342 Set <PropertyDescription > propertyDescriptionSet = new HashSet <>();
343- metaDescription .getTraits ().stream ()
343+ metaDescription .computeAllTraits ().stream ()
344344 .map (c -> c .getProperties ().stream ()
345345 .filter (traitProperty -> propertyDescriptions .stream ().noneMatch (myProperty -> myProperty .getName ().equals (traitProperty .getName ())))
346346 .collect (Collectors .toList ()))
@@ -365,7 +365,7 @@ private void acceptTrait(FM3Trait m) throws IOException {
365365 code .setTraits (m .getTraits ().stream ().map (FM3Type ::getName ).collect (Collectors .toList ()));
366366 code .addImport (FameDescription .class );
367367 code .addImport (FamePackage .class );
368- for (FM3Trait t : m .computeAllTraits ()) {
368+ for (FM3Trait t : m .getTraits ()) {
369369 code .addImport (packageName (t .getPackage ()), t .getName ());
370370 }
371371
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ public void setTraits(Collection<FM3Trait> traits) {
156156 }
157157 }
158158
159- @ FameProperty (name ="traits" , opposite = "owner " )
159+ @ FameProperty (name ="traits" , opposite = "users " )
160160 public Collection <FM3Trait > getTraits () {
161161 return traits .values ();
162162 }
@@ -174,11 +174,16 @@ public boolean isRoot() {
174174 }
175175
176176 public Set <FM3Trait > computeAllTraits () {
177- Set <FM3Trait > traits = new HashSet <>();
178- traits .addAll (getTraits ());
179- for (FM3Trait t : traits ) {
180- traits .addAll (t .computeAllTraits ());
177+ Set <FM3Trait > computedTraits = new HashSet <>();
178+ computedTraits .addAll (getTraits ());
179+ Set <FM3Trait > transitiveTraits = new HashSet <>();
180+
181+ for (FM3Trait t : computedTraits ) {
182+ transitiveTraits .addAll (t .computeAllTraits ());
181183 }
182- return traits ;
184+
185+ computedTraits .addAll (transitiveTraits );
186+ return computedTraits ;
183187 }
188+
184189}
You can’t perform that action at this time.
0 commit comments