The Trunk: Traits-ul.244.mcz

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

The Trunk: Traits-ul.244.mcz

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

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

Name: Traits-ul.244
Author: ul
Time: 12 December 2009, 2:54:25 am
UUID: 9c75f198-c99f-0d4f-9101-bd86669b8c2c
Ancestors: Traits-ar.243

- replace sends of #ifNotNilDo: to #ifNotNil:, #ifNil:ifNotNilDo: to #ifNil:ifNotNil:, #ifNotNilDo:ifNil: to #ifNotNil:ifNil:

=============== Diff against Traits-ar.243 ===============

Item was changed:
  ----- Method: RequiredSelectorsChangesCalculator>>findRootsAndRoutes (in category 'calculating') -----
  findRootsAndRoutes
  "Based on the
  1. target classes (ones considered interesting by our clients) and the
  2. modifiedBehaviors (ones we are told might have changed),
  decide the
  A. rootClasses (superclasses of target classes that include methods from modifiedBehaviors)
  B. classesToUpdate (classes that may have been affected AND are on an inheritance path between a root class and a target class, will be updated by the algorithm. This includes the every target class that may have been affected).
  C. mapping from root classes to its classesToUpdate."
 
  | highestSuperclassOfCurrentTarget modifiedClasses |
  classesToUpdate := IdentitySet new.
  rootClasses := IdentitySet new.
  modifiedClasses := (modifiedBehaviors gather: [:mb | mb classesComposedWithMe]) asIdentitySet.
  targetClasses do: [:currentTargetClass |
  highestSuperclassOfCurrentTarget := nil.
  currentTargetClass withAllSuperclassesDo: [:sc |
  (modifiedClasses includes: sc) ifTrue:
  [highestSuperclassOfCurrentTarget := sc.
  self noteRoot: sc possiblyAffected: currentTargetClass]].
+ highestSuperclassOfCurrentTarget ifNotNil: [:highestRoot |
- highestSuperclassOfCurrentTarget ifNotNilDo: [:highestRoot |
  self addUpdatePathTo: currentTargetClass from: highestRoot]]!

Item was changed:
  ----- Method: RequiredSelectorsChangesCalculator>>sinsIn: (in category 'as yet unclassified') -----
  sinsIn: aClass
  | negativeDefined selfSent sins |
  negativeDefined := IdentitySet new.
  aClass selectorsAndMethodsDo: [:s :m | m isProvided ifFalse: [negativeDefined add: s]].
+ selfSent := aClass sendCaches selfSenders ifNil: [^negativeDefined] ifNotNil: [:dict | dict keys].
- selfSent := aClass sendCaches selfSenders ifNil: [^negativeDefined] ifNotNilDo: [:dict | dict keys].
  sins := negativeDefined union: (selfSent copyWithoutAll: aClass providedSelectors).
  ^sins!

Item was changed:
  ----- Method: TBehaviorCategorization>>category (in category 'organization') -----
  category
  "Answer the system organization category for the receiver. First check whether the
  category name stored in the ivar is still correct and only if this fails look it up
  (latter is much more expensive)"
 
  | result |
+ self basicCategory ifNotNil: [ :symbol |
- self basicCategory ifNotNilDo: [ :symbol |
  ((SystemOrganization listAtCategoryNamed: symbol) includes: self name)
  ifTrue: [ ^symbol ] ].
  self basicCategory: (result := SystemOrganization categoryOfElement: self name).
  ^result!

Item was changed:
  ----- Method: TraitTest>>testLocalMethodWithSameCodeInTrait (in category 'testing') -----
  testLocalMethodWithSameCodeInTrait
  "Note, takes all behaviors (classes and traits) into account"
 
  SystemNavigation default allBehaviorsDo: [ :each |
  each hasTraitComposition ifTrue: [
  each methodDict keys do: [ :selector |
  (each includesLocalSelector: selector) ifTrue: [
+ (each traitComposition traitProvidingSelector: selector) ifNotNil: [ :trait |
- (each traitComposition traitProvidingSelector: selector) ifNotNilDo: [ :trait |
  self deny: (trait >> selector = (each >> selector)) ] ] ] ] ].!

Item was changed:
  ----- Method: TPureBehavior>>literalScannedAs:notifying: (in category 'printing') -----
  literalScannedAs: scannedLiteral notifying: requestor
  "Postprocesses a literal scanned by Scanner scanToken (esp. xLitQuote).
  If scannedLiteral is not an association, answer it.
  Else, if it is of the form:
  nil->#NameOfMetaclass
  answer nil->theMetaclass, if any has that name, else report an error.
  Else, if it is of the form:
  #NameOfGlobalVariable->anythiEng
  answer the global, class, or pool association with that nameE, if any, else
  add it to Undeclared a answer the new Association."
 
  | key value |
  (scannedLiteral isVariableBinding)
  ifFalse: [^ scannedLiteral].
  key := scannedLiteral key.
  value := scannedLiteral value.
  key isNil
  ifTrue: "###<metaclass soleInstance name>"
+ [(self bindingOf: value) ifNotNil:[:assoc|
- [(self bindingOf: value) ifNotNilDo:[:assoc|
  (assoc value isKindOf: Behavior)
  ifTrue: [^ nil->assoc value class]].
  requestor notify: 'No such metaclass'.
  ^false].
  (key isSymbol)
  ifTrue: "##<global var name>"
+ [(self bindingOf: key) ifNotNil:[:assoc | ^assoc].
- [(self bindingOf: key) ifNotNilDo:[:assoc | ^assoc].
  Undeclared at: key put: nil.
  ^Undeclared bindingOf: key].
  requestor notify: '## must be followed by a non-local variable name'.
  ^false
 
  " Form literalScannedAs: 14 notifying: nil 14
  Form literalScannedAs: #OneBitForm notiEfying: nil  OneBitForm
  Form literalScannedAs: ##OneBitForm notifying: nil  OneBitForm->a Form
  Form literalScannedAs: ##Form notifying: nil   Form->Form
  Form literalScannedAs: ###Form notifying: nil   nilE->Form class
  "!

Item was changed:
  ----- Method: TPureBehavior>>requirements (in category 'send caches') -----
  requirements
  ^ self requiredSelectorsCache
  ifNil: [#()]
+ ifNotNil: [:rsc | rsc requirements]!
- ifNotNilDo: [:rsc | rsc requirements]!

Item was changed:
  ----- Method: TraitMethodDescription>>providedMethod (in category 'accessing') -----
  providedMethod
+ ^self providedLocatedMethod ifNotNil: [:locatedMethod | locatedMethod method]!
- ^self providedLocatedMethod ifNotNilDo: [:locatedMethod | locatedMethod method]!