[Pkg] The Trunk: Collections-nice.543.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Nov 19 22:33:50 UTC 2013

Nicolas Cellier uploaded a new version of Collections to project The Trunk:

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

Name: Collections-nice.543
Author: nice
Time: 19 November 2013, 11:33:03.586 pm
UUID: 5642a410-e41a-4753-b1ce-53e5d750e70d
Ancestors: Collections-ul.542

Introduce NotFound Error for errorNotFound: (the comment told it should be a specific error, now it is - this is required for Xtreams).
Eliminate code duplication in KeyNotFound.
Correct typo in String>>translateToUppercase.

=============== Diff against Collections-ul.542 ===============

Item was changed:
  ----- Method: Collection>>errorNotFound: (in category 'private') -----
  errorNotFound: anObject
+ 	"anObject was not found in this collection, raise appropriate error."
- 	"Actually, this should raise a special Exception not just an error."
+ 	^(NotFound object: anObject) signal!
- 	self error: 'Object is not in the collection.'!

Item was changed:
  ----- Method: KeyNotFound>>description (in category 'accessing') -----
  	"Return a textual description of the exception."
+ 	^self messageText!
- 	^(self messageText) ifNil:['Key not found: ', key]!

Item was added:
+ Error subclass: #NotFound
+ 	instanceVariableNames: 'object'
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Collections-Exceptions'!

Item was added:
+ ----- Method: NotFound class>>object: (in category 'instance creation') -----
+ object: anObject
+ 	^self new object: anObject!

Item was added:
+ ----- Method: NotFound>>messageText (in category 'accessing') -----
+ messageText
+ 	"Return a textual description of the exception."
+ 	^messageText ifNil:['Object is not in the collection.']!

Item was added:
+ ----- Method: NotFound>>object (in category 'accessing') -----
+ object
+ 	^object!

Item was added:
+ ----- Method: NotFound>>object: (in category 'accessing') -----
+ object: anObject
+ 	object := anObject!

Item was changed:
  ----- Method: String>>translateToUppercase (in category 'converting') -----
+ 	"Translate all characters to uppercase, in place"
- 	"Translate all characters to lowercase, in place"
  	self translateWith: UppercasingTable!

More information about the Packages mailing list