Issue 334 in glassdb: versioning class references instance of GsClassDocumentation, does not copy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 334 in glassdb: versioning class references instance of GsClassDocumentation, does not copy

glassdb
Status: Accepted
Owner: [hidden email]
Labels: Type-Defect Priority-Medium GLASS-Server Version-GLASS0.231  
bugid-41763

New issue 334 by [hidden email]: versioning class references  
instance of GsClassDocumentation, does not copy
http://code.google.com/p/glassdb/issues/detail?id=334

from original Internal bugreport:

If you have a class, and create a class comment by creating a  
GsClassDocumentation and putting it in the description field, the instance  
of GsClassDocumentation references the class (inst var itsClass).

If you create a new version using the method
subclass:instVarNames:classVars:classInstVars:poolDictionaries:inDictionary:instancesInvariant:newVersionOf:isModifiable:.

it justs sets the description of the new class to the description of the  
old class.  The instance of GsClassDocumentation is now referenced by the  
new class, but GsClassDocumentation.itsClass continues to refer to the old  
class instance.

If you want to get rid of the original class, you migh think all you have  
to do is have no instances and remove it from the classHistory, so this  
results in uncollectable garbage.

findReferencePathToObject: doesn't detect this and declares the class  
disconnected, but findReferences: shows the GsClassDocumentation.

This can still be a problem in 3.0, but only if you really try.
(1) description is nilled during conversion and comments creates from GBS  
are not stored as GsClassDocumentation instances and (2) non-deprecated  
subclass creation methods either require description passed in, or set the  
new description to nil.  So only if you restore your description after  
conversion (which we suggest) and use deprecated subclass creation methods  
(likely in code but not in GBS), is this bug a problem in 3.0.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 334 in glassdb: versioning class references instance of GsClassDocumentation, does not copy

glassdb
Updates:
        Labels: -Version-GLASS0.231 Version-1.0-beta.8

Comment #1 on issue 334 by [hidden email]: versioning class  
references instance of GsClassDocumentation, does not copy
http://code.google.com/p/glassdb/issues/detail?id=334

It looks like this bug was fixed in 2.4.4.7, 2.4.5, and 3.1. Need a glass  
fix for this one, since I think GLASS does it's own thing ...

Reply | Threaded
Open this post in threaded view
|

Re: Issue 334 in glassdb: versioning class references instance of GsClassDocumentation, does not copy

glassdb
Updates:
        Status: Fixed
        Labels: Fixed-1.0-beta.8.7.1

Comment #2 on issue 334 by [hidden email]: versioning class  
references instance of GsClassDocumentation, does not copy
http://code.google.com/p/glassdb/issues/detail?id=334

This has been fixed in GLASS 1.0-beta.8.7.1.

Here's a script (untested) that should repair the problem:


      System myUserProfile symbolList do: [:symbolDictionary |
        symbolDictionary valuesDo: [:global |
          global isBehavior ifTrue: [ | desc |
            (desc := global description) notNil
              ifTrue: [
                description itsClass ~~ global
                  ifTrue: [ global description itsClass: global ]]]].