Inst var mix-up after adding accessors with OB

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

Inst var mix-up after adding accessors with OB

Zulq Alam-2
If you follow these steps using OB 0.382:

        1) Define class Thing
        2) Add inst var "foo"
        3) Add accessors for "foo" using menu
        4) Add inst var "bar" AFTER "foo"
        5) Add accessors for "bar" using menu
       
the instance variable name list will be sorted from:

        instanceVariableNames: 'foo bar'

to:

        instanceVariableNames: 'bar foo'

and the accesors for "foo" will get and set "bar" such that:

        thing := Thing new.
        thing foo: 'foo'.
        thing bar: 'bar'.
        thing foo -> thing bar  "'bar'->'bar'"

If you upgrade to 0.391 the instance variable name list is not sorted so
  effectivley the problem goes away.

I'd like to understand how the OB (or refactoring engine) could modify
the class description without triggering a recompile of the methods?

I tried writing a test case but without knowing how it's side stepping
the usual recompile I got stuck.

Regards,
Zulq.




Reply | Threaded
Open this post in threaded view
|

Re: Inst var mix-up after adding accessors with OB

Damien Cassou-3
Hi Zulq,

I think this was a bug in the RefactoringEngine that Mathieu Suen
corrected some months ago. If you use a recent image, this problem
should not appear.

When you say "if you upgrade to 0.391", you only changed the
OmniBrowser package? Neither the RefactoringEngine, nor the
OBRefactory package?

2007/10/25, Zulq Alam <[hidden email]>:

> If you follow these steps using OB 0.382:
>
>         1) Define class Thing
>         2) Add inst var "foo"
>         3) Add accessors for "foo" using menu
>         4) Add inst var "bar" AFTER "foo"
>         5) Add accessors for "bar" using menu
>
> the instance variable name list will be sorted from:
>
>         instanceVariableNames: 'foo bar'
>
> to:
>
>         instanceVariableNames: 'bar foo'
>
> and the accesors for "foo" will get and set "bar" such that:
>
>         thing := Thing new.
>         thing foo: 'foo'.
>         thing bar: 'bar'.
>         thing foo -> thing bar  "'bar'->'bar'"
>
> If you upgrade to 0.391 the instance variable name list is not sorted so
>   effectivley the problem goes away.
>
> I'd like to understand how the OB (or refactoring engine) could modify
> the class description without triggering a recompile of the methods?
>
> I tried writing a test case but without knowing how it's side stepping
> the usual recompile I got stuck.
>
> Regards,
> Zulq.
>
>
>
>
>


--
Damien Cassou

Reply | Threaded
Open this post in threaded view
|

Re: Inst var mix-up after adding accessors with OB

Zulq Alam-2
I saved my image and then in the package universe browser, I clicked on
"select upgrades" and then "install selection". I'm assuming this sorted
out the dependencies for me.

Damien Cassou wrote:

> Hi Zulq,
>
> I think this was a bug in the RefactoringEngine that Mathieu Suen
> corrected some months ago. If you use a recent image, this problem
> should not appear.
>
> When you say "if you upgrade to 0.391", you only changed the
> OmniBrowser package? Neither the RefactoringEngine, nor the
> OBRefactory package?
>
> 2007/10/25, Zulq Alam <[hidden email]>:
>> If you follow these steps using OB 0.382:
>>
>>         1) Define class Thing
>>         2) Add inst var "foo"
>>         3) Add accessors for "foo" using menu
>>         4) Add inst var "bar" AFTER "foo"
>>         5) Add accessors for "bar" using menu
>>
>> the instance variable name list will be sorted from:
>>
>>         instanceVariableNames: 'foo bar'
>>
>> to:
>>
>>         instanceVariableNames: 'bar foo'
>>
>> and the accesors for "foo" will get and set "bar" such that:
>>
>>         thing := Thing new.
>>         thing foo: 'foo'.
>>         thing bar: 'bar'.
>>         thing foo -> thing bar  "'bar'->'bar'"
>>
>> If you upgrade to 0.391 the instance variable name list is not sorted so
>>   effectivley the problem goes away.
>>
>> I'd like to understand how the OB (or refactoring engine) could modify
>> the class description without triggering a recompile of the methods?
>>
>> I tried writing a test case but without knowing how it's side stepping
>> the usual recompile I got stuck.
>>
>> Regards,
>> Zulq.
>>
>>
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Inst var mix-up after adding accessors with OB

Damien Cassou-3
2007/10/25, Zulq Alam <[hidden email]>:
> I saved my image and then in the package universe browser, I clicked on
> "select upgrades" and then "install selection". I'm assuming this sorted
> out the dependencies for me.


So, RefactoringEngine may have been upgraded too, which explains it now works.

Bye


> Damien Cassou wrote:
> > Hi Zulq,
> >
> > I think this was a bug in the RefactoringEngine that Mathieu Suen
> > corrected some months ago. If you use a recent image, this problem
> > should not appear.
> >
> > When you say "if you upgrade to 0.391", you only changed the
> > OmniBrowser package? Neither the RefactoringEngine, nor the
> > OBRefactory package?
> >
> > 2007/10/25, Zulq Alam <[hidden email]>:
> >> If you follow these steps using OB 0.382:
> >>
> >>         1) Define class Thing
> >>         2) Add inst var "foo"
> >>         3) Add accessors for "foo" using menu
> >>         4) Add inst var "bar" AFTER "foo"
> >>         5) Add accessors for "bar" using menu
> >>
> >> the instance variable name list will be sorted from:
> >>
> >>         instanceVariableNames: 'foo bar'
> >>
> >> to:
> >>
> >>         instanceVariableNames: 'bar foo'
> >>
> >> and the accesors for "foo" will get and set "bar" such that:
> >>
> >>         thing := Thing new.
> >>         thing foo: 'foo'.
> >>         thing bar: 'bar'.
> >>         thing foo -> thing bar  "'bar'->'bar'"
> >>
> >> If you upgrade to 0.391 the instance variable name list is not sorted so
> >>   effectivley the problem goes away.
> >>
> >> I'd like to understand how the OB (or refactoring engine) could modify
> >> the class description without triggering a recompile of the methods?
> >>
> >> I tried writing a test case but without knowing how it's side stepping
> >> the usual recompile I got stuck.
> >>
> >> Regards,
> >> Zulq.
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>
>


--
Damien Cassou

Reply | Threaded
Open this post in threaded view
|

Re: Inst var mix-up after adding accessors with OB

Zulq Alam-2
Thanks Damien.

Damien Cassou wrote:
> 2007/10/25, Zulq Alam <[hidden email]>:
>> I saved my image and then in the package universe browser, I clicked on
>> "select upgrades" and then "install selection". I'm assuming this sorted
>> out the dependencies for me.
>
>
> So, RefactoringEngine may have been upgraded too, which explains it now works.
>
> Bye