[Glass] Instances of obsolete classes after stone upgrade

Johan Brichau johan at yesplan.be
Fri Nov 19 09:29:44 PST 2021


Hi,

After upgrading a GLASS/Seaside repository from 2.4.4.1 to 3.4.5, I notice there are still a lot of instances of the obsolete classes SimpleBlock, ComplexVCBlock, ExecutableBlock, ComplexBlock
We noticed these instances are references held by the methods in which they are defined. 

Is that ‘expected’ ? Since all methods are recompiled when upgrading, should there still be instances of these obsolete block classes?
Running the following code removes the references, but we do get a SecurityError when it tries to recompile GsPackagePolicy class>>initialize. We run it as DataCurator. Should we run it as SystemUser?

    | obsoleteBlockClasses blockArrays sourceClasses |
    obsoleteBlockClasses := Array withAll: (ObsoleteClasses select: [ :object | object isClass and: [ object inheritsFrom: BlockClosure ] ]).
    blockArrays := SystemRepository listInstances: obsoleteBlockClasses.
    sourceClasses := IdentitySet new.
    blockArrays do: [ :blocks |
        blocks do: [ :block |
            block method inClass ifNotNil: [ :sourceClass |
                sourceClasses add: sourceClass ] ] ].
    sourceClasses do: [ :sourceClass |
        Transcript show: ('Recompiling class {1} ({2})' format: { sourceClass name. sourceClass asOop }).
        sourceClass recompileAllMethods ].


Thanks for insights!
Johan


More information about the Glass mailing list