Skip to content

Commit

Permalink
DumpVisitor: handle unexpected FMMultivalueLink due to improper prope…
Browse files Browse the repository at this point in the history
…rty description

See moosetechnology/FAST-JAVA#210
  • Loading branch information
Gabriel-Darbord committed Dec 21, 2023
1 parent 4f6a972 commit 54b34b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/FAST-Core-Tools/FASTDumpVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ FASTDumpVisitor >> initialize [

{ #category : #enumerating }
FASTDumpVisitor >> propertiesAndValuesOf: aFASTEntity do: twoArgsBlock [

"Iterate over the attributes and child relations of the given entity."

| value |
(self propertiesOf: aFASTEntity)
select: [ :property |
(property isChildrenProperty or: [
(property hasOpposite | property isDerived) not ]) and: [
select: [ :property |
(property isChildrenProperty or: [
(property hasOpposite | property isDerived) not ]) and: [
value := aFASTEntity perform: property implementingSelector.
property isMultivalued
ifTrue: [ value isNotEmpty ]
Expand Down Expand Up @@ -69,14 +68,15 @@ FASTDumpVisitor >> visit: aFASTEntity [
| beforeFirst |
beforeFirst := true.
stream << aFASTEntity className << ' new '.
self propertiesAndValuesOf: aFASTEntity do: [ :property :value |
self propertiesAndValuesOf: aFASTEntity do: [ :property :value |
beforeFirst
ifTrue: [ beforeFirst := false ]
ifFalse: [ stream nextPut: $; ].
stream nextPutAll: property implementingSelector asMutator.
property hasOpposite
ifTrue: [ "relation"
property isMultivalued
(property isMultivalued or: [ "temporary check until https://github.com/moosetechnology/FAST-JAVA/issues/210 is fixed"
value isKindOf: FMMultivalueLink ])
ifFalse: [ self visitOnlyChild: value ]
ifTrue: [ self visitChildren: value ] ]
ifFalse: [ "attribute" value printOn: stream ] ]
Expand Down

0 comments on commit 54b34b2

Please sign in to comment.