File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Gcj.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Kjc.java | |||
Method name: boolean execute()
|
Method name: boolean execute()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Commandline cmd;↵ | |||
2 | attributes.log("Using gcj compiler", Project.MSG_VERBOSE);↵ | 1 | attributes.log("Using kjc compiler", Project.MSG_VERBOSE);↵ | |
3 | cmd = setupGCJCommand();↵ | 2 | Commandline cmd = setupKjcCommand();↵ | |
4 | int firstFileName = cmd.size();↵ | 3 | ↵ | |
5 | logAndAddFilesToCompile↵ | 4 | cmd.setExecutable("at.dms.kjc.Main");↵ | |
5 | ExecuteJava ej = new ExecuteJava();↵ | |||
6 | (cmd);↵ | 6 | ej.setJavaCommand(cmd);↵ | |
7 | return↵ | 7 | return↵ | |
8 | executeExternalCompile(cmd.getCommandline(), firstFileName) == 0; | 8 | ej.fork(getJavac()) == 0; | |
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 having the same super class |
Number of node comparisons | 30 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Commandline cmd; | | ||||||||||||||||||||||
2 | attributes.log("Using gcj compiler", Project.MSG_VERBOSE); |
| 1 | attributes.log("Using kjc compiler", Project.MSG_VERBOSE); | ||||||||||||||||||||
| 2 | Commandline cmd = setupKjcCommand(); | ||||||||||||||||||||||
| 3 | cmd.setExecutable("at.dms.kjc.Main"); | ||||||||||||||||||||||
3 | cmd = setupGCJCommand(); | | ||||||||||||||||||||||
| 4 | ExecuteJava ej = new ExecuteJava(); | ||||||||||||||||||||||
4 | int firstFileName = cmd.size(); | | ||||||||||||||||||||||
5 | logAndAddFilesToCompile(cmd); |
| 5 | ej.setJavaCommand(cmd); | ||||||||||||||||||||
6 | return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0; |
| 6 | return ej.fork(getJavac()) == 0; |
Row | Violation |
---|---|
1 | Expression logAndAddFilesToCompile(cmd) is a void method call, and thus it cannot be parameterized |
2 | Expression ej.setJavaCommand(cmd) is a void method call, and thus it cannot be parameterized |
3 | Expression logAndAddFilesToCompile(cmd) is a void method call, and thus it cannot be parameterized |
4 | Expression ej.setJavaCommand(cmd) is a void method call, and thus it cannot be parameterized |
5 | Expression executeExternalCompile(cmd.getCommandline(),firstFileName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression ej.fork(getJavac()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression executeExternalCompile(cmd.getCommandline(),firstFileName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression ej.fork(getJavac()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |