On Tue, 16 Jul 2002 07:15:22 GMT, [EMAIL PROTECTED] (Thomas Singer)
wrote:

>If you mean the conversions from 
>  Foo.doSomething(Foo foo, int value);
>to
>  foo.doSomething(int value);
>I agree with you:

You can do it by using inline method.

Example:
class Foo{
        public static void doSomething(Foo foo, int value){
                handle(foo, value);
        }
}

Extract method:
class Foo{
        public static void doSomething(Foo foo, int value){
                tempDoSomething(foo, value);
        }

        private static void tempDoSomething(Foo foo, int value) {
                handle(foo, value);
        }
}

"Hand code to"
class Foo{
        public static void doSomething(Foo foo, int value){
                foo.tempDoSomething(value);
        }

        public void tempDoSomething(int value) {
                handle(this, value);
        }
}

Inline doSomething then rename tempDoSomething to doSomething:
class Foo{
        public void doSomething(int value){
                handle(this, value);
        }
}

Now every call of "Foo.doSomething(foo, value);" will look like 
"foo.doSomething(value);"


Sincerely

Jens Peter Grosen
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features

Reply via email to