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_COMMENT);
cmd.createArgument().setValue(getComment());
}
if (getTask() != null) {
cmd.createArgument().setValue(FLAG_TASK);
cmd.createArgument().setValue(getTask());
}
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/CCMCheck.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_COMMENT);↵
|
2 | commandLine.createArgument().setValue(getSosHome());↵ | | 2 | cmd.createArgument().setValue(getComment());↵
|
3 | }↵ | | 3 | }↵
|
4 | //If a working directory was specified then add it to the command line↵ | | |
|
5 | if (getLocalPath() != null) {↵ | | 4 | if (getTask() != null) {↵
|
6 | commandLine.createArgument().setValue(FLAG_WORKING_DIR);↵ | | 5 | cmd.createArgument().setValue(FLAG_TASK);↵
|
7 | commandLine.createArgument().setValue(getLocalPath());↵ | | 6 | cmd.createArgument().setValue(getTask());↵
|
8 | } | | 7 | }
|
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | if (getLocalPath() != null) | | 4 | if (getTask() != null) |
8 | commandLine.createArgument().setValue(FLAG_WORKING_DIR); | | 5 | cmd.createArgument().setValue(FLAG_TASK); |
9 | commandLine.createArgument().setValue(getLocalPath()); | | 6 | cmd.createArgument().setValue(getTask()); |
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 |