Method history at GemStone level

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

Method history at GemStone level

GLASS mailing list
Hi,

GS: 3.4.1.

Creating a new method is create two entries in method history.
Is this a bug or an intented behavior ?

To reproduce:
1) Create a method named #test in Object class
2) Check method history
   2.1) Evaluate:  (MethodVersionHistory uniqueInstance versionsOfMethod:
#test in: Object) size
   2.2) or Inspect: MethodVersionHistory uniqueInstance versionsOfMethod:
#test in: Object

There are two entries of MethodVersionRecord.

regards,
bruno



--
Sent from: http://forum.world.st/GLASS-f1460844.html
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Method history at GemStone level

GLASS mailing list
i tracked the problem in two places:
1) Behavior>>compileMethod:category:using:environmentId:
2) MethodVersionHistory>>addVersionFor:oldMeth:oldStamp:oldCategory:

1) (oldCat := self categoryOfSelector: sel) "never answer [nil] for new
methods"
  So [oldMeth] temp never is [nil].
  [oldMeth] is passed to
MethodVersionHistory>>addVersionFor:oldMeth:oldStamp:oldCategory:.

2) For new methods [coll] is [nil] and as stated in 1) [oldMethod] is not
[nil].
  So two entries of MethodVersionRecord are added (at line 20 and 27).

Solution in 2)
Put [^mDict at: selector put: coll] at line 26 in order to avoid another
addFirst: call.

Solution in 1)
Or fix (oldCat := self categoryOfSelector: sel) to answer [nil] for new
methods.

regards,
bruno



--
Sent from: http://forum.world.st/GLASS-f1460844.html
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass