Refactoring --- Improving the Design of Existing Code >>
<< Refactor the program before adding the feature
Extract Method need-to-know

Author Zhou Renjian Create@ 2004-12-09 16:26
whizz Note icon
public class TestRefactor {
    public static void main(String[] args) {
        int i = 0;
        int j = 234;
        i++;
        j++;
        int k = 23 + i;
        System.out.println(k);
        System.out.println(j);
    }
}

When selecting the following section and trying to Extract Method in Eclipse JDT, it will popup dialog to tell you that you can not extract method, as "Ambigous return value: selected block contains more than one assignment to local variable.
        i++;
        j++;
        int k = 23 + i;
...
本记录所在类别:
本记录相关记录: