File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/DependSelector.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/PresentSelector.java | |||
Method name: String toString()
|
Method name: String toString()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | StringBuffer buf = new StringBuffer("{dependselector targetdir: ");↵ | 1 | StringBuffer buf = new StringBuffer("{presentselector targetdir: ");↵ | |
2 | if (targetdir == null) {↵ | 2 | if (targetdir == null) {↵ | |
3 | buf.append("NOT YET SET");↵ | 3 | buf.append("NOT YET SET");↵ | |
4 | } else {↵ | 4 | } else {↵ | |
5 | buf.append(targetdir.getName());↵ | 5 | buf.append(targetdir.getName());↵ | |
6 | }↵ | 6 | }↵ | |
7 | buf.append(" granularity: ");↵ | 7 | buf.append(" present: ");↵ | |
8 | buf.append(granularity);↵ | 8 | ↵ | |
9 | if (map != null) {↵ | |||
10 | buf.append(" mapper: ");↵ | 9 | if (destmustexist) {↵ | |
10 | buf.append("both");↵ | |||
11 | } else {↵ | |||
12 | buf.append("srconly");↵ | |||
13 | }↵ | |||
14 | if (map != null) {↵ | |||
11 | buf.append(map.toString());↵ | 15 | buf.append(map.toString());↵ | |
12 | } else if (mapperElement != null) {↵ | 16 | } else if (mapperElement != null) {↵ | |
13 | buf.append(" mapper: ");↵ | |||
14 | buf.append(mapperElement.toString());↵ | 17 | buf.append(mapperElement.toString());↵ | |
15 | }↵ | 18 | }↵ | |
16 | buf.append("}");↵ | 19 | buf.append("}");↵ | |
17 | return buf.toString(); | 20 |
| |
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.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 59 |
Number of mapped statements | 11 |
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) | 5.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | StringBuffer buf = new StringBuffer("{dependselector targetdir: "); |
| 1 | StringBuffer buf = new StringBuffer("{presentselector targetdir: "); | ||||||||||
2 | if (targetdir == null) | 2 | if (targetdir == null) | |||||||||||
3 | buf.append("NOT YET SET"); | 3 | buf.append("NOT YET SET"); | |||||||||||
else | else | |||||||||||||
4 | buf.append(targetdir.getName()); | 4 | buf.append(targetdir.getName()); | |||||||||||
5 | buf.append(" granularity: "); |
| 5 | buf.append(" present: "); | ||||||||||
| 6 | if (destmustexist) | ||||||||||||
|
| 7 | buf.append("both"); | |||||||||||
| else | |||||||||||||
|
| 8 | buf.append("srconly"); | |||||||||||
6 | buf.append(granularity); |
| | |||||||||||
7 | if (map != null) | 9 | if (map != null) | |||||||||||
8 | buf.append(" mapper: "); |
| | |||||||||||
9 | buf.append(map.toString()); | 10 | buf.append(map.toString()); | |||||||||||
10 | else if (mapperElement != null) | 11 | else if (mapperElement != null) | |||||||||||
11 | buf.append(" mapper: "); |
| | |||||||||||
12 | buf.append(mapperElement.toString()); | 12 | buf.append(mapperElement.toString()); | |||||||||||
13 | buf.append("}"); | 13 | buf.append("}"); | |||||||||||
14 | return buf.toString(); | 14 | return buf.toString(); |
Row | Violation |
---|---|
1 | Unmatched statement buf.append("both"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement buf.append("srconly"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement buf.append(granularity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement buf.append(" mapper: "); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement buf.append(" mapper: "); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |