File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/rmic/SunRmic.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Javac12.java | |||
Method name: boolean execute()
|
Method name: boolean execute()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | Class c = Class.forName(RMIC_CLASSNAME);↵ | 1 | Class c = Class.forName(CLASSIC_COMPILER_CLASSNAME);↵ | |
2 | Constructor cons↵ | 2 | Constructor cons =↵ | |
3 | = c.getConstructor(new Class[] {OutputStream.class,↵ | 3 | c.getConstructor(new Class[] {OutputStream.class,↵ | |
4 | String.class});↵ | 4 | String.class});↵ | |
5 | Object rmic↵ | 5 | Object compiler↵ | |
6 | = cons.newInstance(new Object[] {logstr, "rmic"});↵ | 6 | = cons.newInstance(new Object[] {logstr, "javac"});↵ | |
7 | Method doRmic↵ | 7 | // Call the compile() method↵ | |
8 | = c.getMethod("compile",↵ | 8 | Method compile = c.getMethod("compile",↵ | |
9 | new Class [] {String[].class}); | 9 | new Class [] {String[].class}); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 10 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | Class c = Class.forName(RMIC_CLASSNAME); |
| 5 | Class c = Class.forName(CLASSIC_COMPILER_CLASSNAME); | ||||||||||||||||
6 | Constructor cons = c.getConstructor(new Class[] {OutputStream.class, String.class}); | 6 | Constructor cons = c.getConstructor(new Class[] {OutputStream.class, String.class}); | |||||||||||||||||
7 | Object rmic = cons.newInstance(new Object[] {logstr, "rmic"}); |
| 7 | Object compiler = cons.newInstance(new Object[] {logstr, "javac"}); | ||||||||||||||||
8 | Method doRmic = c.getMethod("compile", new Class[] {String[].class}); |
| 8 | Method compile = c.getMethod("compile", new Class[] {String[].class}); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables rmic, doRmic , while Clone fragment #2 returns variables compiler, compile |
2 | The refactoring of the clones is infeasible, because classes org.apache.tools.ant.taskdefs.rmic.SunRmic and org.apache.tools.ant.taskdefs.compilers.Javac12 do not have a common superclass |