Skip to content

Commit

Permalink
Merge pull request #95 from dolphinsmalltalk/blairmc/structprint
Browse files Browse the repository at this point in the history
Fix ExternalStructure>>printOn: for structs with non-readable fields
  • Loading branch information
blairmcg committed Feb 27, 2016
2 parents 26b33bf + 38ef3a8 commit e40d4ce
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions Core/Object Arts/Dolphin/Base/ExternalStructure.cls
Original file line number Diff line number Diff line change
Expand Up @@ -356,20 +356,27 @@ printCyclicRefOn: aStream
aStream nextPutAll: '...'!

printFieldsOn: aStream limit: anInteger
| sep |
self isNull
ifTrue: [aStream nextPutAll: 'NULL']
ifFalse:
[self getValidFields do:
[:field |
aStream position > anInteger
ifTrue:
[aStream nextPutAll: '... etc ...'.
^self].
ifTrue:
[aStream nextPutAll: 'NULL'.
^self].
sep := [sep := [aStream space]].
self getValidFields do:
[:each |
| field |
aStream position > anInteger
ifTrue:
[aStream nextPutAll: '... etc ...'.
^self].
field := self template at: each.
field isReadable
ifTrue:
[sep value.
aStream
display: field;
display: each;
nextPutAll: '=';
print: (self getField: field)]
separatedBy: [aStream space]]!
print: (self getField: each)]]!

printOn: aStream
"Append a textual representation of the receiver to aStream.
Expand Down

0 comments on commit e40d4ce

Please sign in to comment.