Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DumpVisitor: handle unexpected FMMultivalueLink due to improper property description #43

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/FAST-Core-Model-Extension/FASTTEntity.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ FASTTEntity >> display [
{ #category : #'*FAST-Core-Model-Extension' }
FASTTEntity >> inspectionFAST [

<inspectorPresentationOrder: 450 title: 'FAST'>
<inspectorPresentationOrder: 1.1 title: 'FAST'>
^ SpTreeTablePresenter new
addColumn: (SpCompositeTableColumn new
addColumn: ((SpImageTableColumn evaluated: #mooseIcon)
width: 20;
yourself);
addColumn: (SpStringTableColumn evaluated: [ :node | node display ]);
addColumn:
(SpStringTableColumn evaluated: [ :node | node display ]);
yourself);
children: [ :aClass |
aClass children asArray sorted: [ :a :b |
(a startPos ifNil: 0) <= (b startPos ifNil: 0) ] ];
children: [ :aClass |
aClass children asArray sorted: [ :a :b |
(a startPos ifNil: [ 0 ]) <= (b startPos ifNil: [ 0 ]) ] ];
beMultipleSelection;
roots: { self };
beResizable
Expand All @@ -48,9 +49,9 @@ FASTTEntity >> inspectionFAST [
{ #category : #'*FAST-Core-Model-Extension' }
FASTTEntity >> inspectionFASTSourceCode [

<inspectorPresentationOrder: 500 title: 'FASTSourceCode'>
(self sourceText isNotNil and: [
self startPos isNotNil and: [ self endPos isNotNil ] ]) ifFalse: [
<inspectorPresentationOrder: 1.2 title: 'FASTSourceCode'>
(self sourceText isNotNil and: [
self startPos isNotNil and: [ self endPos isNotNil ] ]) ifFalse: [
^ SpTextPresenter new
text: 'Not available';
yourself ].
Expand Down
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
2 changes: 1 addition & 1 deletion src/FAST-Core-Tools/FASTTEntity.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FASTTEntity >> dump [
{ #category : #'*FAST-Core-Tools' }
FASTTEntity >> inspectionFASTDump [

<inspectorPresentationOrder: 550 title: 'FASTDump'>
<inspectorPresentationOrder: 1.3 title: 'FASTDump'>
^ SpCodePresenter new
text: (RBParser parseExpression: self dump) formattedCode;
beForScripting;
Expand Down
Loading