try {
Project aProj = getProject();
Execute exe
= new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN));
exe.setAntRun(aProj);
exe.setWorkingDirectory(aProj.getBaseDir());
exe.setCommandline(cmd.getCommandline());
return exe.execute();
} catch (java.io.IOException e) {
throw new BuildException(e, getLocation());
}
try {
Execute exe = new Execute(new LogStreamHandler(this,
Project.MSG_INFO,
Project.MSG_WARN));
exe.setAntRun(getProject());
exe.setWorkingDirectory(getProject().getBaseDir());
exe.setCommandline(cmd.getCommandline());
exe.setVMLauncher(false); // Use the OS VM launcher so we get environment variables
return exe.execute();
} catch (java.io.IOException e) {
throw new BuildException(e, getLocation());
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java
|
Method name: int run(Commandline)
|
|
Method name: int run(Commandline)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | try {↵ | | 1 | try {↵
|
2 | Project aProj = getProject();↵ | | 2 | ↵
|
3 | Execute exe↵ | | |
|
4 | = new Execute(new LogStreamHandler(this, Project.MSG_INFO,↵ | | 3 | Execute exe = new Execute(new LogStreamHandler(this,↵
|
| | | 4 | Project.MSG_INFO,↵
|
5 | Project.MSG_WARN));↵ | | 5 | Project.MSG_WARN));↵
|
|
6 | exe.setAntRun(aProj);↵ | | 6 | exe.setAntRun(getProject());↵
|
7 | exe.setWorkingDirectory(aProj.getBaseDir());↵ | | 7 | exe.setWorkingDirectory(getProject().getBaseDir());↵
|
8 | exe.setCommandline(cmd.getCommandline());↵ | | 8 | exe.setCommandline(cmd.getCommandline());↵
|
| | | 9 | exe.setVMLauncher(false); // Use the OS VM launcher so we get environment variables↵
|
9 | return exe.execute();↵ | | 10 | return exe.execute();↵
|
10 | } catch (java.io.IOException e) {↵ | | 11 | } catch (java.io.IOException e) {↵
|
11 | throw new BuildException(e, getLocation());↵ | | 12 | throw new BuildException(e, getLocation());↵
|
12 | } | | 13 | }
|
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 49 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | Project aProj = getProject(); | | | |
3 | Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN)); | | 2 | Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN)); |
4 | | | 3 | exe.setAntRun(getProject()); |
5 | exe.setWorkingDirectory(aProj.getBaseDir()); | | 4 | exe.setWorkingDirectory(getProject().getBaseDir()); |
6 | exe.setCommandline(cmd.getCommandline()); | | 5 | exe.setCommandline(cmd.getCommandline()); |
| | | 6 | exe.setVMLauncher(false); |
7 | | | 7 | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement exe.setVMLauncher(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables exe |