Hi,
thank you for supplying RefactorIt. I'm looking for refactorings "while2foreach" and "forIndex2foreach"
Refactoring "while2foreach":
Ugly old code fragment ("while-iter-localVar"):
Iterator<Node> it = iterableExpression.iterator();
while (it.hasNext()) {
Node akt = (Node) it.next();
bodyCode (without references to 'it')
}
or ("while-iter-outerVar")::
Iterator<Node> it = iterableExpression.iterator();
Node akt;
while (it.hasNext()) {
akt = (Node) it.next();
bodyCode (without references to 'it')
}
Equivalent nice new code fragment ("for-each"):
for (Node akt : iterableExpression) {
bodyCode
}
Refactoring "forIndex2foreach":
Ugly old code fragment ("for-index"):
iterableExpression
for (int i = 1; i < iterableExpression.size() + 1; i++) {
File partFile = (File) iterableExpression.get(i);
bodyCode (without references to 'i')
}
Equivalent nice new code ("for-each"):
for (File partFile : iterableExpression) {
bodyCode (without references to 'i')
}
How difficult is it to extend RefactorIt with these two refactorings?
Thanks,
Michael
Michael_Huebner_de (at) ya hoo.de
Now RefactorIt is Open Source, so anyone could contribute ;) Unfortunately Aqris team are busy with other project most of the time, so no new features are expected from us, but if there is a good quality patch we will be glad to apply it.