On Mon, Mar 21, 2016 at 3:51 PM, Johannes Brauer
<brauer@nordakademie.de> wrote:
HI Johannes,
Could I see the source of the DmQuartalsplan>>#initialize: ?
yes, of course:
'From Pharo4.0 of 18 March 2013 [Latest update: #40626] on 21 March 2016 at 6:19:38.568095 pm'!
!DmQuartalsplan methodsFor: 'initialize-release' stamp: ' 15/1/14 15:24'!
initialize: einQuartal
self
lehrveranstaltungen:
(SortedCollection
sortBlock: [:x :y | x modul modulNummer <= y modul modulNummer]).
self quartal: einQuartal! !
I am not sure if the following will work. Please backup your image file and all your fuel files.
But...what if you try to implement:
DmQuartalsplan >> fuelReplacement
| copy |
copy := self copy.
copy lehrveranstaltungen: copy lehrveranstaltungen asOrderedCollection.
^ copy
And finally, at the image where you are materializing, you could implement:
DmQuartalsplan >> fuelAfterMaterialization
self lehrveranstaltungen: (self lehrveranstaltungen asSortedCollection: [:x :y | x modul modulNummer <= y modul modulNummer])
Once the migration is done, you can discard #fuelReplacement and #fuelAfterMaterialization if you want.
I never tried this approach, so I am not sure ;)
Joh.
I think I workaround may be to do a Fuel replacement to replace the sortedCollection with an OrderedCollection and then a post initialize method.
But again, probably seeing if the closure of the sorted collection is clean or not may have different behaviors.
Cheers,