'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 12 May 2003 at 11:48:08 am'! "Change Set: Deprecation Date: 9 May 2003 Author: Brent Pinkney Introduce a Warning exception, Deprecation, to manage the deprecation of methods and classes from the image. Added deprecated:explanation: to provide some explanation if necessary. Remove the others (the ones without explanation because as a client I deserve comments and explanation)."! Warning subclass: #Deprecation instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'System-Exceptions Kernel'! !Deprecation commentStamp: 'dew 5/21/2003 17:46' prior: 0! This Warning is signalled by methods which are deprecated. The use of Object>>#deprecatedExplanation: aString and Object>>#deprecated: aBlock explanation: aString is recommended. Idiom: Imagine I want to deprecate the message #foo. foo ^ 'foo' I can replace it with: foo self deprecatedExplanation: 'The method #foo was not good. Use Bar>>newFoo instead.' ^ 'foo' Or, for certain cases such as when #foo implements a primitive, #foo can be renamed to #fooDeprecated. fooDeprecated ^ foo ^ self deprecated: [self fooDeprecated] explanation: 'The method #foo was not good. Use Bar>>newFoo instead.' ! !Object methodsFor: 'error handling' stamp: 'sd 5/11/2003 18:34'! deprecated: aBlock explanation: aString "Warn that the sender has been deprecated. answer the value of aBlock on resumption" Deprecation signal: thisContext sender printString, ' has been deprecated. ', aString. ^ aBlock value.! ! !Object methodsFor: 'error handling' stamp: 'sd 5/11/2003 18:34'! deprecatedExplanation: aString "Warn that the sending method has been deprecated" Deprecation signal: thisContext sender printString, ' has been deprecated. ', aString ! ! !Warning methodsFor: 'exceptionDescription' stamp: 'brp 5/9/2003 12:54'! defaultAction "The user should be notified of the occurrence of an exceptional occurrence and given an option of continuing or aborting the computation. The description of the occurrence should include any text specified as the argument of the #signal: message." Debugger openContext: thisContext label: 'Warning' contents: self messageText, '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs. self resume! !