Skip to content

Commit

Permalink
second version:
Browse files Browse the repository at this point in the history
- always add removed Classes to Undeclared. This might lead to unused entries, but that can happen even without the check
  • Loading branch information
MarcusDenker committed Jul 10, 2020
1 parent 432559e commit 78738ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 44 deletions.
3 changes: 1 addition & 2 deletions src/GeneralRules/ReGlobalVariablesUsageRule.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ ReGlobalVariablesUsageRule >> check: aMethod forCritiquesDo: aCriticBlock [
node isVariable and: [
node variable isGlobalVariable and: [
(self isKnownGlobal: node name) not and: [
node variable isGlobalClassNameBinding not
and: node variable value isObsolete not ] ] ] ]
node variable isGlobalClassNameBinding not ] ] ] ]
thenDo: [ :node |
aCriticBlock cull: (self
createTrivialCritiqueOn: aMethod
Expand Down
41 changes: 0 additions & 41 deletions src/GeneralRules/ReReferencesObsoleteClassRule.class.st

This file was deleted.

5 changes: 4 additions & 1 deletion src/Kernel/Class.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,10 @@ Class >> removeFromSystem: logged [
self superclass ifNotNil:
["If we have no superclass there's nothing to be remembered"
self superclass addObsoleteSubclass: self].


"we add the class to Undeclared so that if references still exist, they will be automatically fixed
if this class is loaded again. We do not check if references exist as it is too slow"
Undeclared declare: self name asSymbol from: Smalltalk globals.
myCategory := self category.
self environment forgetClass: self logged: logged.
self obsolete.
Expand Down

0 comments on commit 78738ba

Please sign in to comment.