ObsoleteMethodCallWarning.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 22948 7db274fb5ecb
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22948
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
     1
"{ Encoding: utf8 }"
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
     2
19711
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
 COPYRIGHT (c) 2016 by eXept Software AG
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
              All Rights Reserved
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 This software is furnished under a license and may be used
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
 hereby transferred.
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libbasic' }"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
"{ NameSpace: Smalltalk }"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
HaltInterrupt subclass:#ObsoleteMethodCallWarning
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:''
22948
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    20
	classVariableNames:'IgnoredWarnings'
19711
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Kernel-Exceptions-Control'
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!ObsoleteMethodCallWarning class methodsFor:'documentation'!
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 2016 by eXept Software AG
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
              All Rights Reserved
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    Raised when an obsolete method is called.
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    Thus used to do a halt; now this separate exception is raised to make it
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    easier to separately handle this.
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    Still a kind of programmed debug-breakpoint.
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    [author:]
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        Claus Gittinger
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
"
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
! !
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!ObsoleteMethodCallWarning class methodsFor:'initialization'!
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
initialize
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    NotifierString := 'Obsolete method called'.
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
     self initialize.
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
! !
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
22948
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    63
!ObsoleteMethodCallWarning class methodsFor:'ignoring'!
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    64
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    65
ignoreWarningFrom:aContext
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    66
    "add aContext's method to the ignoredWarnings set.
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    67
     This will stop the warning during this session."
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    68
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    69
    |con|
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    70
    
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    71
    IgnoredWarnings isNil ifTrue:[
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    72
        IgnoredWarnings := Set new.
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    73
    ].
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    74
    con := aContext.
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    75
    [con notNil and:[con selector startsWith:'obsoleteMethodWarning']]
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    76
    whileTrue:[
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    77
        con := con sender
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    78
    ].   
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    79
    con notNil ifTrue:[
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    80
        IgnoredWarnings add:(con method whoString)
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    81
    ].
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    82
! !
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    83
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    84
!ObsoleteMethodCallWarning class methodsFor:'raising'!
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    85
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    86
raiseRequestErrorString:errorString
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    87
    |con|
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    88
    
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    89
    IgnoredWarnings notNil ifTrue:[
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    90
        con := thisContext sender.
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    91
        [con notNil and:[con selector startsWith:'obsoleteMethodWarning']]
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    92
        whileTrue:[
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    93
            con := con sender
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    94
        ].   
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    95
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    96
        (IgnoredWarnings includes:(con method whoString)) ifTrue:[
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    97
            ^ self
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    98
        ].    
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
    99
    ].
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
   100
    super raiseRequestErrorString:errorString.
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
   101
! !
7db274fb5ecb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19711
diff changeset
   102
19711
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!ObsoleteMethodCallWarning class methodsFor:'documentation'!
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
version
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    ^ '$Header$'
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
!
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
version_CVS
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    ^ '$Header$'
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
! !
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
ce5eca41f3d1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
ObsoleteMethodCallWarning initialize!