--- a/ClassBuilder.st Fri Oct 20 16:34:07 2006 +0200
+++ b/ClassBuilder.st Mon Oct 23 10:52:31 2006 +0200
@@ -1113,17 +1113,17 @@
"/ WOW, everything done for this class
"/ what about subclasses ?
- "/ update superclass of immediate subclasses -
- "/ this forces recompilation (recursively) if needed
- "/ (dont update change file for the subclass changes)
-
- Class classRedefinitionNotification answer:#keep do:[
- Class withoutUpdatingChangesDo:[
- oldClass subclasses copy do:[:aClass |
- aClass superclass:newClass
- ]
- ]
- ].
+"/ "/ update superclass of immediate subclasses -
+"/ "/ this forces recompilation (recursively) if needed
+"/ "/ (dont update change file for the subclass changes)
+"/
+"/ Class classRedefinitionNotification answer:#keep do:[
+"/ Class withoutUpdatingChangesDo:[
+"/ oldClass subclasses copy do:[:aClass |
+"/ aClass superclass:newClass
+"/ ]
+"/ ]
+"/ ].
"/ change any private subclasses' owners
@@ -1154,6 +1154,18 @@
].
].
+ "/ update superclass of immediate subclasses -
+ "/ this forces recompilation (recursively) if needed
+ "/ (dont update change file for the subclass changes)
+
+ Class classRedefinitionNotification answer:#keep do:[
+ Class withoutUpdatingChangesDo:[
+ oldClass subclasses copy do:[:aClass |
+ aClass superclass:newClass
+ ]
+ ]
+ ].
+
"/ Not becoming the old class creates some update problems;
"/ the browsers must check carefully - a simple identity compare is
"/ not enough ...
@@ -1165,6 +1177,7 @@
(systemBrowsers will react on this, and update their views)"
oldClass changed:#definition with:newClass.
+ Class flushSubclassInfo.
self environmentChanged:#classDefinition with:newClass.
ObjectMemory flushCaches.
@@ -1182,9 +1195,9 @@
Class flushSubclassInfo.
^ newClass
- "Created: / 26.5.1996 / 11:55:26 / cg"
- "Modified: / 18.3.1999 / 18:23:31 / stefan"
- "Modified: / 13.2.2000 / 22:59:57 / cg"
+ "Created: / 26-05-1996 / 11:55:26 / cg"
+ "Modified: / 18-03-1999 / 18:23:31 / stefan"
+ "Modified: / 22-10-2006 / 00:44:48 / cg"
!
handleNewlyCreatedClass:newClass
@@ -1964,21 +1977,36 @@
superInstVars := aClass allInstVarNames.
stringOfInstVarNames asCollectionOfWords do:[:nm |
(superInstVars includes:nm) ifTrue:[
- (oldClass notNil
- and:[stringOfInstVarNames = oldClass instanceVariableString])
- ifTrue:[
- Transcript showCR:('instVar conflict in `' , newName , ''' for `' , nm , ''' due to superclass change.').
- ParserFlags warnings ifTrue:[
- msg := 'InstVar conflict in `' , newName allBold , ''' for `' , nm allBold, ''' due to superclass change.\You now have two different instVar slots with the same name.\\Don''t forget to fix this later.'.
+ msg := 'instVar "%1" is already defined in a superclass of "%2"' bindWith:nm allBold with:newName allBold.
+ "/ experimental
+ Tools::CompilerWarningToDoListEntry notNil ifTrue:[
+ self todo:((Tools::CompilerWarningToDoListEntry new
+ severity:(ToDoList errorSeverity)
+ priority:(ToDoList highPriority)
+ timestamp:(Timestamp now)
+ message:msg)
+ className:newName
+ selector:nil
+ checkAction:[:e |
+ |superClass class|
+
+ superClass := Smalltalk classNamed:aClass name.
+ class := Smalltalk classNamed:newName.
+
+ (superClass allInstVarNames includes:nm) and:[class instVarNames includes:nm]]
+ equalityParameter:nm).
+ ].
+ ParserFlags warnings ifTrue:[
+ (oldClass notNil
+ and:[stringOfInstVarNames = oldClass instanceVariableString])
+ ifTrue:[
+ msg := 'InstVar conflict in "%1" for "%2" due to superclass change.\You now have two different instVar slots with the same name.\\Don''t forget to fix this later.' bindWith:newName allBold with:nm allBold.
self warn:msg withCRs.
- ]
- ] ifFalse:[
- Transcript showCR:('instVar `' , nm , ''' is already defined in a superclass of `' , newName , '''.').
- ParserFlags warnings ifTrue:[
- msg := 'instVar `' , nm allBold, ''' is already defined in a superclass.\Change the definition of `' , newName allBold, ''' anyway ?\\Don''t forget to fix this later.'.
+ ] ifFalse:[
+ msg := 'instVar "%1" is already defined in a superclass.\Change the definition of "%2" anyway ?\\Don''t forget to fix this later.' bindWith:nm allBold with:newName allBold.
^ self confirm:msg withCRs
- ]
- ].
+ ].
+ ]
]
].
].
@@ -1995,18 +2023,30 @@
|msg|
(vars includes:nm) ifTrue:[
- msg := ('subclass `'
- , sub name allBold
- , ''' already defines an instVar named `'
- , nm allBold
- , '''.\\Change the definition of `'
- , newName allBold
- , ''' anyway ?\Notice: you must fix this later.'
- ) withCRs.
+ msg := 'subclass "%1" also defines an instVar named "%2"' bindWith:sub name allBold with:nm allBold.
+ "/ experimental
+ Tools::CompilerWarningToDoListEntry notNil ifTrue:[
+ self todo:((Tools::CompilerWarningToDoListEntry new
+ severity:(ToDoList errorSeverity)
+ priority:(ToDoList highPriority)
+ timestamp:(Timestamp now)
+ message:msg)
+ className:newName
+ selector:nil
+ checkAction:[:e |
+ |class|
+
+ Class flushSubclassInfo.
+ class := Smalltalk classNamed:newName.
+
+ (class instVarNames includes:nm)
+ and:[ class allSubclasses contains:[:aSubclass | aSubclass instVarNames includes:nm]]]
+ equalityParameter:nm).
+ ].
ParserFlags warnings ifTrue:[
+ msg := ('subclass "%1" also defines an instVar named "%2".\\Change the definition of "%3" anyway ?\Notice: you must fix this later.'
+ bindWith:sub name allBold with:nm allBold with:newName allBold) withCRs.
^ self confirm:msg
- ] ifFalse:[
- Transcript showCR:msg
]
]
]
@@ -2014,7 +2054,8 @@
].
^ true
- "Created: 29.1.1997 / 17:42:11 / cg"
+ "Created: / 29-01-1997 / 17:42:11 / cg"
+ "Modified: / 22-10-2006 / 01:54:46 / cg"
!
checkValidPools
@@ -2089,5 +2130,5 @@
!ClassBuilder class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ClassBuilder.st,v 1.59 2006-10-06 13:50:17 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ClassBuilder.st,v 1.60 2006-10-23 08:52:31 cg Exp $'
! !