if (value.length() == 0) {
throw new BuildException("Begin token cannot "
+ "be empty");
}
beginToken = params[i].getValue().charAt(0);
if ("endtoken".equals(name)) {
if (value.length() == 0) {
throw new BuildException("End token cannot "
+ "be empty");
}
endToken = params[i].getValue().charAt(0);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/ReplaceTokens.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/ReplaceTokens.java
|
Method name: void initialize()
|
|
Method name: void initialize()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
| | | 1 | if ("endtoken".equals(name)) {↵
|
1 | if (value.length() == 0) {↵ | | 2 | if (value.length() == 0) {↵
|
2 | throw new BuildException("Begin token cannot "↵ | | 3 | throw new BuildException("End token cannot "↵
|
3 | + "be empty");↵ | | 4 | + "be empty");↵
|
4 | }↵ | | 5 | }↵
|
5 | beginToken = params[i].getValue().charAt(0); | | 6 | endToken = params[i].getValue().charAt(0);↵
|
| | | 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 the same method |
Number of node comparisons | 7 |
-
{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) | 1.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | if (value.length() == 0) | | 14 | if (value.length() == 0) |
11 | throw new BuildException("Begin token cannot " + "be empty"); | | 15 | throw new BuildException("End token cannot " + "be empty"); |
12 | beginToken = params[i].getValue().charAt(0); | | 16 | endToken = params[i].getValue().charAt(0); |
Precondition Violations (0)
Row |
Violation |