commandLine.createArgument().setValue(FLAG_SOS_HOME);
commandLine.createArgument().setValue(getSosHome());
}
//If a working directory was specified then add it to the command line
if (getLocalPath() != null) {
commandLine.createArgument().setValue(FLAG_WORKING_DIR);
commandLine.createArgument().setValue(getLocalPath());
}
cmd.createArgument().setValue(FLAG_PLATFORM);
cmd.createArgument().setValue(getPlatform());
} // end of if ()
if (getResolver() != null) {
cmd.createArgument().setValue(FLAG_RESOLVER);
cmd.createArgument().setValue(getResolver());
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ccm/CCMCreateTask.java
|
Method name: void getOptionalAttributes()
|
|
Method name: void checkOptions(Commandline)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | commandLine.createArgument().setValue(FLAG_SOS_HOME);↵ | | 1 | cmd.createArgument().setValue(FLAG_PLATFORM);↵
|
2 | commandLine.createArgument().setValue(getSosHome());↵ | | 2 | cmd.createArgument().setValue(getPlatform());↵
|
3 | }↵ | | 3 | }↵
|
4 | //If a working directory was specified then add it to the command line↵ | | 4 | // end of if ()↵
|
|
5 | if (getLocalPath() != null) {↵ | | 5 | if (getResolver() != null) {↵
|
6 | commandLine.createArgument().setValue(FLAG_WORKING_DIR);↵ | | 6 | cmd.createArgument().setValue(FLAG_RESOLVER);↵
|
7 | commandLine.createArgument().setValue(getLocalPath());↵ | | 7 | cmd.createArgument().setValue(getResolver());↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
-
{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) | 4.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | if (getLocalPath() != null) | | 7 | if (getResolver() != null) |
8 | commandLine.createArgument().setValue(FLAG_WORKING_DIR); | | 8 | cmd.createArgument().setValue(FLAG_RESOLVER); |
9 | commandLine.createArgument().setValue(getLocalPath()); | | 9 | cmd.createArgument().setValue(getResolver()); |
Precondition Violations (1)
Row |
Violation |
1 | Expression getLocalPath() is a method call throwing exception(s) that should be caught by a try block that will be extracted |