[7.7.1 Store] browse method versions fails after package rename

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

[7.7.1 Store] browse method versions fails after package rename

Reinout Heeck-2
Using the RB selectors list context menu Store->Browse Versions usually
pops up a list of method versions.

To my surprise this failed ('No prior versions' dialog) on code that was
loaded from store.

It turns out that this package has been renamed and all versions of this
method were published prior to the rename.

The offending code seems to be the last statement in MethodDefinition >>
asStoreObjectInPackage which assumes packages can only have one name
over their lifetime:

     [.......]
     ^versions
         detect: [:each | each package name = packageModel name]
         ifNone: [nil]




Any fix available?


R
-


--
*********************************************************************

Dit e-mailbericht is alleen bestemd voor de geadresseerde(n).

Gebruik door anderen is niet toegestaan. Indien u niet degeadresseerde(n) bent wordt u verzocht de verzender hiervan op de hoogte te stellen en het bericht te verwijderen. Door de elektronische verzending kunnen aan de inhoud van dit bericht geen rechten worden ontleend.

Soops B.V. is gevestigd te Amsterdam, Nederland, en is geregistreerd bij de Kamer van Koophandel onder nummer 33240368.
Soops B.V. levert volgens de Fenit voorwaarden, gedeponeerd te Den Haag op 8 december 1994 onder nummer 1994/189.
**********************************************************************

This e-mail message is intended to be exclusively for the addressee.

If you are not the intended recipient you are kindly requested not to make any use whatsoever of the contents and to notify the sender immediately by returning this e-mail message. No rights can be derived from this message.

Soops B.V. is a private limited liability company and has its seat at Amsterdam, The Netherlands and is registered with the Trade Registry of the Chamber of Commerce and Industry under number 33240368.
Soops B.V. delivers according to the General Terms and Conditions of Business of Fenit, registered at The Hague, The Netherlands on December 8th, 1994, under number 1994/189
**********************************************************************


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [7.7.1 Store] browse method versions fails after package rename

Niall Ross
Dear Reinout,
    AR 62118 Cannot browse method versions if method unchanged after
package rename

Replacing the very last line with

     ^versions
         detect: [:each | each package name = packageModel name]
         ifNone: [versions first]

solves the immediate problem but may cause side effects, possibly
serious ones;  I will test further.  Please let me know if you try this
and see odd behaviour, and please also let me know if you try it and see
OK behaviour.

          Yours faithfully
             Niall Ross

>Using the RB selectors list context menu Store->Browse Versions usually
>pops up a list of method versions.
>
>To my surprise this failed ('No prior versions' dialog) on code that was
>loaded from store.
>
>It turns out that this package has been renamed and all versions of this
>method were published prior to the rename.
>
>The offending code seems to be the last statement in MethodDefinition >>
>asStoreObjectInPackage which assumes packages can only have one name
>over their lifetime:
>
>     [.......]
>     ^versions
>         detect: [:each | each package name = packageModel name]
>         ifNone: [nil]
>
>
>
>
>Any fix available?
>
>
>R
>-
>
>
>  
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [AR 62118] browse method versions fails after package rename

Reinout Heeck-2
Super service, thank you!


I pushed this into our development builds, will let you know if it breaks.

I altered the suggested fix because it did not handle the case where the
versions collection is empty (freshly created/unpublished method).
The tail of the method now looks like this:


     versions isEmpty ifTrue: [^nil].
     packageModel ifNil: [^versions first].
     ^versions detect: [:each | each package name = packageModel name]
         ifNone: [versions first]




I have trouble understanding what this method is expected to do, the
fixes seem to suggest that the #detect: loop can be replaced by a simple
#first.


Cheers!

Reinout
-------



On 1/25/2011 6:36 PM, Niall Ross wrote:

> Dear Reinout,
>    AR 62118 Cannot browse method versions if method unchanged after
> package rename
>
> Replacing the very last line with
>
>     ^versions
>         detect: [:each | each package name = packageModel name]
>         ifNone: [versions first]
>
> solves the immediate problem but may cause side effects, possibly
> serious ones;  I will test further.  Please let me know if you try
> this and see odd behaviour, and please also let me know if you try it
> and see OK behaviour.
>
>          Yours faithfully
>             Niall Ross
>
>> Using the RB selectors list context menu Store->Browse Versions
>> usually pops up a list of method versions.
>>
>> To my surprise this failed ('No prior versions' dialog) on code that
>> was loaded from store.
>>
>> It turns out that this package has been renamed and all versions of
>> this method were published prior to the rename.
>>
>> The offending code seems to be the last statement in MethodDefinition
>> >> asStoreObjectInPackage which assumes packages can only have one
>> name over their lifetime:
>>
>>     [.......]
>>     ^versions
>>         detect: [:each | each package name = packageModel name]
>>         ifNone: [nil]
>>
>>
>>
>>
>> Any fix available?
>>
>>
>> R
>> -
>>
>>
>>
>>
>
>
>


--
*********************************************************************

Dit e-mailbericht is alleen bestemd voor de geadresseerde(n).

Gebruik door anderen is niet toegestaan. Indien u niet degeadresseerde(n) bent wordt u verzocht de verzender hiervan op de hoogte te stellen en het bericht te verwijderen. Door de elektronische verzending kunnen aan de inhoud van dit bericht geen rechten worden ontleend.

Soops B.V. is gevestigd te Amsterdam, Nederland, en is geregistreerd bij de Kamer van Koophandel onder nummer 33240368.
Soops B.V. levert volgens de Fenit voorwaarden, gedeponeerd te Den Haag op 8 december 1994 onder nummer 1994/189.
**********************************************************************

This e-mail message is intended to be exclusively for the addressee.

If you are not the intended recipient you are kindly requested not to make any use whatsoever of the contents and to notify the sender immediately by returning this e-mail message. No rights can be derived from this message.

Soops B.V. is a private limited liability company and has its seat at Amsterdam, The Netherlands and is registered with the Trade Registry of the Chamber of Commerce and Industry under number 33240368.
Soops B.V. delivers according to the General Terms and Conditions of Business of Fenit, registered at The Hague, The Netherlands on December 8th, 1994, under number 1994/189
**********************************************************************


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc