Currently you can do this easily - create wrapper method accepting the parameter object, find all occurences of the target method, change them to use the wrapper. Then you can inline the target method. I can't see an intelligent way to automate this (since I don't want classfulls of ugly generated code)...
2c -- dimiter "Jacques Morel" <[EMAIL PROTECTED]> wrote in message news:ahdcbf$smb$[EMAIL PROTECTED]... > +1 > > "Maria Ekerholm" <[EMAIL PROTECTED]> wrote in message > news:ahcp61$8sv$[EMAIL PROTECTED]... > > Greetings, > > > > in a case where you have a method with lots of parameters, it would be > nice > > to have a refactoring that enabled you to introduce a class to hold those > > parameters such that: > > > > before: > > void aMethod(Class1 c1, Class2 c2, Class3 c3, int i4) { > > c1.yada(); > > } > > > > after: > > void aMethod(ParameterObject at1) { > > at1.getC1().yada(); // note > > } > > > > a new class: > > final class ParameterObject { > > private Class c1; > > private Class c2; > > private Class c3; > > private int i4; > > > > /* a constructor that takes all fields */ > > > > /* getters and setters for all fields (except the primitive ones > for > > consistency) */ > > > > } > > > > also, IDEA would, of course, ask to change all invocations of the method > > from: > > > > aMethod(c1, c2, c3, i4); > > > > to: > > > > aMethod(new ParameterObject(c1, c2, c3, i4)); > > > > The method ought to be renamable at that time. The name of the parameter > > object class must be configurable (of course). > > > > It should be possible to select different sub-sets and orders of the > > parameters for the constructor of the parameter object > > > > > > regards, > > Patrik and Odd > > > > > > _______________________________________________ Eap-features mailing list [EMAIL PROTECTED] http://lists.jetbrains.com/mailman/listinfo/eap-features
