The Trunk: Environments-ul.40.mcz

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

The Trunk: Environments-ul.40.mcz

commits-2
Levente Uzonyi uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-ul.40.mcz

==================== Summary ====================

Name: Environments-ul.40
Author: ul
Time: 29 December 2013, 8:22:31.244 pm
UUID: 7af01b34-5d81-46c4-90e9-bcc2fbdc4042
Ancestors: Environments-cmm.39

Make sure that when a class is renamed, the integrity of all dictionaries which can contain it in the Environment are kept.

=============== Diff against Environments-cmm.39 ===============

Item was added:
+ ----- Method: Environment>>remove:from:readdAfter: (in category 'private') -----
+ remove: binding from: aDictionary readdAfter: aBlock
+
+ aDictionary
+ removeKey: binding key
+ ifAbsent: [ ^aBlock value ].
+ ^aBlock ensure: [ aDictionary add: binding ]!

Item was changed:
  ----- Method: Environment>>renameClass:from:to: (in category 'classes and traits') -----
  renameClass: aClass from: oldName to: newName
  "Rename the class, aClass, to have the title newName."
 
+ | binding category |
+ binding := declarations associationAt: oldName.
- | oldref category |
  category := self organization categoryOfElement: oldName.
  self organization classify: newName under: category suppressIfDefault: true.
  self organization removeElement: oldName.
+ self
+ remove: binding
+ from: declarations
+ readdAfter: [
+ self
+ remove: binding
+ from: references
+ readdAfter: [
+ self
+ remove: binding
+ from: public
+ readdAfter: [
+ binding key: newName ] ] ].
- oldref := self associationAt: oldName.
- declarations removeKey: oldName.
- oldref key: newName.
- declarations add: oldref.
  Smalltalk renamedClass: aClass from: oldName to: newName.
  SystemChangeNotifier uniqueInstance
  classRenamed: aClass
  from: oldName
  to: newName
  inCategory: category!