BugFix: AddMethodChange class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

BugFix: AddMethodChange class

Carsten Haerle
It seems that protocals can be empty, so printOn: crashes on certain
AddMethodChange instances. Fix below

Regards

Carsten Haerle


!AddMethodChange methodsFor!

protocol
 ^self protocols notEmpty ifTrue: [ self protocols first ] ifFalse: [ nil ]!
!
!AddMethodChange categoriesFor: #protocol!accessing!public! !

!AddMethodChange methodsFor!

printOn: aStream
 aStream
  nextPut: $!!;
  nextPutAll: self displayClassName;
  nextPutAll: ' methodsFor: ''';
  nextPutAll: (self protocol displayString ifNotNil: [:p | p displayString]
ifNil: ['']);
  nextPutAll: '''!!!!';
  cr;
  cr;
  nextPutAll: source;
  nextPutAll: '!! !!'! !
!AddMethodChange categoriesFor: #printOn:!printing!public! !


Reply | Threaded
Open this post in threaded view
|

Re: BugFix: AddMethodChange class

Blair McGlashan-3
"Carsten Haerle" <[hidden email]> wrote in message
news:4113c18a$0$13050$[hidden email]...
> It seems that protocals can be empty, so printOn: crashes on certain
> AddMethodChange instances. Fix below

Thanks Carsten, duly recorded for patching in 5.1.5.

Regards

Blair