--- a/GenericException.st Tue Aug 28 11:30:07 2018 +0200
+++ b/GenericException.st Tue Aug 28 11:31:21 2018 +0200
@@ -413,23 +413,24 @@
!GenericException class methodsFor:'queries'!
-accepts:aSignal
- "return true, if the receiver accepts the argument, aSignal.
+accepts:aSignalOrExceptionClass
+ "return true, if the receiver accepts the argument, aSignalOrExceptionClass.
(i.e. the receiver is aSignal or a parent of it). False otherwise."
|s|
- self == aSignal ifTrue:[^ true].
- aSignal isQuerySignal ifTrue:[^ false].
-
- s := aSignal parent.
- [s notNil] whileTrue:[
- self == s ifTrue:[^ true].
- s := s parent
+ self == aSignalOrExceptionClass ifTrue:[^ true].
+ "/ the following line depends on this method being redefined in the Notification subclass
+ aSignalOrExceptionClass isQuerySignal ifTrue:[^ false].
+
+ s := aSignalOrExceptionClass.
+ [(s := s parent) notNil] whileTrue:[
+ self == s ifTrue:[^ true].
].
^ false
- "Created: / 23.7.1999 / 14:00:47 / stefan"
+ "Created: / 23-07-1999 / 14:00:47 / stefan"
+ "Modified (comment): / 28-08-2018 / 11:14:59 / Claus Gittinger"
!
exception:anException isHandledIn:aContext
@@ -521,17 +522,21 @@
"return true, if the receiver handles the argument, anException.
(i.e. the receiver is anExceptions signal or a parent of it)"
- |signal|
-
- signal := anException creator.
-
- self == signal ifTrue:[^ true]. "quick check"
- anException isNotification ifTrue:[^ false]. "speed up queries by not traversing the parent chain"
-
- [(signal := signal parent) notNil] whileTrue:[
- self == signal ifTrue:[^ true].
- ].
- ^ false
+ ^ self accepts:(anException creator).
+
+"/ |signal|
+"/
+"/ signal := anException creator.
+"/
+"/ self == signal ifTrue:[^ true]. "quick check"
+"/ anException isNotification ifTrue:[^ false]. "speed up queries by not traversing the parent chain"
+"/
+"/ [(signal := signal parent) notNil] whileTrue:[
+"/ self == signal ifTrue:[^ true].
+"/ ].
+"/ ^ false
+
+ "Modified: / 28-08-2018 / 11:30:49 / Claus Gittinger"
!
isAcceptedBy:aHandlerSignal
@@ -565,13 +570,13 @@
existing Signals."
self == GenericException ifTrue:[
- ^ nil
+ ^ nil
].
-
- ^ self superclass
-
- "Created: / 23.7.1999 / 14:01:29 / stefan"
- "Modified: / 23.7.1999 / 16:15:38 / stefan"
+ ^ "self" superclass
+
+ "Created: / 23-07-1999 / 14:01:29 / stefan"
+ "Modified: / 23-07-1999 / 16:15:38 / stefan"
+ "Modified: / 28-08-2018 / 11:13:28 / Claus Gittinger"
! !
!GenericException class methodsFor:'raising'!