ClassPrimitiveChange.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:49:07 +0200
changeset 4458 abe7565c10fb
parent 4209 8db1fbb0e63b
permissions -rw-r--r--
#REFACTORING by exept class: SourceCodeManagerUtilities changed: #diffSetOfProject:againstRepositoryVersionFrom:orTag:extensionsOnly: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     1
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     2
 COPYRIGHT (c) 1999 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     3
              All Rights Reserved
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     4
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     5
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     6
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     8
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     9
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    10
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    11
"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    13
4209
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    14
"{ NameSpace: Smalltalk }"
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    15
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
ClassChange subclass:#ClassPrimitiveChange
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'System-Changes'
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    23
!ClassPrimitiveChange class methodsFor:'documentation'!
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    24
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    25
copyright
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    26
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    27
 COPYRIGHT (c) 1999 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    28
              All Rights Reserved
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    29
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    30
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    31
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    33
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    34
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    35
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    36
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    37
2164
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    38
!
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    39
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    40
documentation
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    41
"
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    42
    Abstract superclass for all primitive code changes
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    43
"
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    44
! !
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
4209
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    46
!ClassPrimitiveChange class methodsFor:'queries'!
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    47
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    48
isAbstract
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    49
    "Return if this class is an abstract class.
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    50
     True is returned here for myself only; false for subclasses.
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    51
     Abstract subclasses must redefine this again."
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    52
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    53
    ^ self == ClassPrimitiveChange.
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    54
! !
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
    55
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
!ClassPrimitiveChange methodsFor:'accessing'!
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
class:aClass source:newSource
1470
9d217f808e0f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
    59
    self assert:(newSource isString).
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    60
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    61
    className := aClass name.
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    source := newSource
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "Created: 3.12.1995 / 14:02:40 / cg"
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    "Modified: 3.12.1995 / 14:06:33 / cg"
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
! !
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
2370
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    68
!ClassPrimitiveChange methodsFor:'applying'!
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    69
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    70
apply
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    71
    "apply the change"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    72
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    73
    |class|
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    74
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    75
    class := self changeClass.
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    76
    class isNil ifTrue:[
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    77
        self error:('Cannot apply change for missing class: ' , className) mayProceed:true.
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    78
        ^ self
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    79
    ].
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    80
    class autoload.         "Most changes cannot be applied to unloaded classes"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    81
    Class nameSpaceQuerySignal answer:self nameSpace do:[
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    82
        self privateApply
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    83
    ].
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    84
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    85
    "Created: / 28-06-2011 / 22:58:53 / cg"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    86
!
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    87
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    88
privateApply
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    89
    self subclassResponsibility
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    90
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    91
    "Created: / 28-06-2011 / 22:58:59 / cg"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    92
! !
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    93
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    94
!ClassPrimitiveChange methodsFor:'comparing'!
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    95
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    96
sameAs:changeB
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    97
    "return true, if the given change represents the same change as the receiver."
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    98
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    99
    (self isForSameAs:changeB) ifFalse:[^ false].
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
   100
    ^ self sameSourceAs:changeB
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
   101
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
   102
! !
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
   103
3501
2ec70319140a category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
   104
!ClassPrimitiveChange methodsFor:'testing'!
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
isPrimitiveChange
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    ^ true
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
! !
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
!ClassPrimitiveChange class methodsFor:'documentation'!
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
version
4209
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
   113
    ^ '$Header$'
2370
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   114
!
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   115
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   116
version_CVS
4209
8db1fbb0e63b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3501
diff changeset
   117
    ^ '$Header$'
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
! !
3501
2ec70319140a category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
   119