Class Version Name for a changed method

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Class Version Name for a changed method

Postby gkipe » Wed Feb 24, 2010 9:35 am

If I have a class name, and a method name, what is the easiest way to get the version name and signature of the class that the method was created or changed in?
The CMMI auditors are on my back, I am writing a quick report for them.
Thanks
gkipe
 
Posts: 24
Joined: Tue Feb 03, 2009 11:05 am

Re: Class Version Name for a changed method

Postby marten » Wed Feb 24, 2010 11:05 am

gkipe wrote:If I have a class name, and a method name, what is the easiest way to get the version name and signature of the class that the method was created or changed in?
The CMMI auditors are on my back, I am writing a quick report for them.
Thanks


Open a browser, select the class, select the method and look at the button of this browser and you see the information :wink:

or as an example:

AbtPart is the class, userInfo the method name ...

Code: Select all
(AbtPart allMethodsNamed: #userInfo) asArray first editionStamp


or perhaps better:

Code: Select all
(AbtPart compiledMethodAt: #userInfo) editionStamp


and you get '(05.11.1996 10:02:27) from AbtBaseApp'

Or for the class of that method you may view the following code:

Code: Select all
      | controller aClass |
      aClass := (AbtPart compiledMethodAt: #userInfo) methodClass.
      controller := aClass controller.
      ( aClass signatureIn: controller) inspect
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Class Version Name for a changed method

Postby gkipe » Wed Feb 24, 2010 11:38 am

Marten thank you for your code snippets, but what I need is the Class version string in which that method was changed.
For example I have 3 versions of a class.
MyClass [ my comments for version 1 ] 0.1
MyClass [ my comments for version 2 ] 0.2
MyClass [ my comments for version 3 ] 0.3

I made a change in version 0.2 to #myMethod. I want to be able to ask MyClass, which version was #myMethod added to the class or changed. And it would return MyClass [ my comments for version 2 ] 0.2.

The code below will always return the most recent version ( 0.3 )
| controller aClass |
aClass := (AbtPart compiledMethodAt: #userInfo) methodClass.
controller := aClass controller.
( aClass signatureIn: controller) inspect

Thanks
gkipe
 
Posts: 24
Joined: Tue Feb 03, 2009 11:05 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest