Constructor cons =
c.getConstructor(new Class[] {OutputStream.class,
String.class});
Object compiler
= cons.newInstance(new Object[] {logstr, "javac"});
// Call the compile() method
Method compile = c.getMethod("compile",
new Class [] {String[].class});
Constructor cons
= c.getConstructor(new Class[] {OutputStream.class, String.class});
Object rmic = cons.newInstance(new Object[] {logstr, "rmic"});
Method doRmic = c.getMethod("compile",
new Class [] {String[].class});
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Javac12.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
|
Method name: boolean execute()
|
|
Method name: boolean execute()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | Constructor cons =↵ | | 1 | Constructor cons↵
|
2 | c.getConstructor(new Class[] {OutputStream.class,↵ | | 2 | = c.getConstructor(new Class[] {OutputStream.class,↵
|
3 | String.class});↵ | | 3 | String.class});↵
|
4 | Object compiler↵ | | 4 | Object ↵
|
5 | = cons.newInstance(new Object[] {logstr, "javac"});↵ | | 5 | rmic = cons.newInstance(new Object[] {logstr, "rmic"});↵
|
|
6 | // Call the compile() method↵ | | 6 | ↵
|
7 | Method compile = c.getMethod("compile",↵ | | 7 | Method doRmic = c.getMethod("compile",↵
|
8 | new Class [] {String[].class}); | | 8 | new Class [] {String[].class});
|
See real code fragment |
|
See real code fragment |
Summary
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 | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | Constructor cons = c.getConstructor(new Class[] {OutputStream.class, String.class}); | | 6 | Constructor cons = c.getConstructor(new Class[] {OutputStream.class, String.class}); |
7 | Object compiler = cons.newInstance(new Object[] {logstr, "javac"}); | | 7 | Object rmic = cons.newInstance(new Object[] {logstr, "rmic"}); |
8 | Method compile = c.getMethod("compile", new Class[] {String[].class}); | | 8 | Method doRmic = c.getMethod("compile", new Class[] {String[].class}); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables compiler, compile , while Clone fragment #2 returns variables rmic, doRmic |