getting real changes from RB refactoring

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

getting real changes from RB refactoring

Peter Uhnak
Hi,

is there some filter that will reject RB changes that actually do not do anything? I.e. applying them would have no effect (same method code, class, inst var exists, ...).

For methods I can do

reject: [ :each | each oldVersionTextToDisplay = each textToDisplay ]

for adding classes I had to add custom #oldVersionTextToDisplay

```
RBAddClassChange>>oldVersionTextToDisplay
        | class |
        class := Smalltalk globals at: self changeClassName ifAbsent: [ ^ '' ].
        ^ '<1s> subclass: #<2s><n><t>instanceVariableNames: <3p><n><t>classVariableNames: <4p><n><t>poolDictionaries: ''''<n><t>category: ''<5s>'''
                expandMacrosWithArguments:
                        {class superclass name.
                        class name.
                        class instanceVariables joinUsing: ' '.
                        class classVariables joinUsing: ' '.
                        class package name}
```

which is obviously ugly.

Also RBAddClassChange doesn't understand any format where #package is used instead of #category, or slots are used.

(As defined in RBAddClassChange class>>definitionPatterns , which is really weird).

Peter

Reply | Threaded
Open this post in threaded view
|

Re: getting real changes from RB refactoring

stepharong
Hi peter


> is there some filter that will reject RB changes that actually do not do  
> anything? I.e. applying them would have no effect (same method code,  
> class, inst var exists, ...).

I do not know.
Do you have an example of when such changes are created?

> For methods I can do
>
> reject: [ :each | each oldVersionTextToDisplay = each textToDisplay ]
>
> for adding classes I had to add custom #oldVersionTextToDisplay
>
> ```
> RBAddClassChange>>oldVersionTextToDisplay
> | class |
> class := Smalltalk globals at: self changeClassName ifAbsent: [ ^ '' ].
> ^ '<1s> subclass: #<2s><n><t>instanceVariableNames:  
> <3p><n><t>classVariableNames: <4p><n><t>poolDictionaries:  
> ''''<n><t>category: ''<5s>'''
> expandMacrosWithArguments:
> {class superclass name.
> class name.
> class instanceVariables joinUsing: ' '.
> class classVariables joinUsing: ' '.
> class package name}
> ```
>
> which is obviously ugly.
>
> Also RBAddClassChange doesn't understand any format where #package is  
> used instead of #category, or slots are used.
>
> (As defined in RBAddClassChange class>>definitionPatterns , which is  
> really weird).

We should change this.


>
> Peter
>


--
Using Opera's mail client: http://www.opera.com/mail/

Reply | Threaded
Open this post in threaded view
|

Re: getting real changes from RB refactoring

Peter Uhnak
On Sun, Feb 12, 2017 at 6:33 PM, stepharong <[hidden email]> wrote:
Hi peter


is there some filter that will reject RB changes that actually do not do anything? I.e. applying them would have no effect (same method code, class, inst var exists, ...).

I do not know.
Do you have an example of when such changes are created?

Well, I generate the changes with thisĀ https://github.com/peteruhnak/xml-magritte-generator

So when I want to regenerate the code, I want to see just the things that will be actually changed.