The Inbox: Exceptions-fbs.38.mcz

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

The Inbox: Exceptions-fbs.38.mcz

commits-2
Frank Shearar uploaded a new version of Exceptions to project The Inbox:
http://source.squeak.org/inbox/Exceptions-fbs.38.mcz

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

Name: Exceptions-fbs.38
Author: fbs
Time: 27 January 2013, 11:20:51.934 am
UUID: 5aa34dd7-e81f-440a-9786-c9d5344be008
Ancestors: Exceptions-cmm.37

#subclassResponsibility in-Debugger method creation #1 of 4: signal a SubclassResponsibilityError when you want to indicate that a subclass has failed to fulfil its semi-abstract superclass's contract.

=============== Diff against Exceptions-cmm.37 ===============

Item was added:
+ Error subclass: #SubclassResponsibilityError
+ instanceVariableNames: 'selector offendingClass calledArguments'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Exceptions-Kernel'!
+
+ !SubclassResponsibilityError commentStamp: 'fbs 1/26/2013 00:20' prior: 0!
+ I am signalled when a subclass fails to implement an "abstract method" and something sends an instance of this subclass the unimplemented message.!

Item was added:
+ ----- Method: SubclassResponsibilityError class>>class:selector:arguments: (in category 'instance creation') -----
+ class: aClass selector: aSelector arguments: someObjects
+ ^ self basicNew initializeWithClass: aClass selector: aSelector arguments: someObjects.!

Item was added:
+ ----- Method: SubclassResponsibilityError>>calledArguments (in category 'accessing') -----
+ calledArguments
+ ^ calledArguments.!

Item was added:
+ ----- Method: SubclassResponsibilityError>>initializeWithClass:selector:arguments: (in category 'initialize-release') -----
+ initializeWithClass: aClass selector: aSelector arguments: someObjects
+ offendingClass := aClass.
+ selector := aSelector.
+ calledArguments := someObjects.!

Item was added:
+ ----- Method: SubclassResponsibilityError>>offendingClass (in category 'accessing') -----
+ offendingClass
+ ^ offendingClass.!

Item was added:
+ ----- Method: SubclassResponsibilityError>>selector (in category 'accessing') -----
+ selector
+ ^ selector.!

Item was added:
+ ----- Method: SubclassResponsibilityError>>selectorCategory (in category 'accessing') -----
+ selectorCategory
+ | organizer organizers |
+ organizer := offendingClass organization.
+ organizers := offendingClass withAllSuperclasses collect: [:ea | ea organization].
+
+ ^ (organizers collect: [ :org | org categoryOfElement: selector])
+ detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
+ ifNone: [ClassOrganizer default]!

Item was added:
+ ----- Method: SubclassResponsibilityError>>signal (in category 'signaling') -----
+ signal
+ self messageText: ('My {1} subclass should have overridden {2}'
+ format: {offendingClass name. selector}).
+ ^ super signal.!