File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Extension.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Specification.java | |||
Method name: String toString()
|
Method name: String toString()
|
|||
Number of AST nodes: 36 | Number of AST nodes: 31 | |||
1 | final String brace = ": ";↵ | 1 | final String brace = ": ";↵ | |
2 | final StringBuffer sb↵ | 2 | final StringBuffer sb↵ | |
3 | = new StringBuffer(EXTENSION_NAME.toString());↵ | 3 | = new StringBuffer(SPECIFICATION_TITLE.toString());↵ | |
4 | sb.append(brace);↵ | 4 | sb.append(brace);↵ | |
5 | sb.append(extensionName);↵ | 5 | sb.append(specificationTitle);↵ | |
6 | sb.append(StringUtils.LINE_SEP);↵ | 6 | sb.append(StringUtils.LINE_SEP);↵ | |
7 | if (null != specificationVersion) {↵ | 7 | if (null != specificationVersion) {↵ | |
8 | sb.append(SPECIFICATION_VERSION);↵ | 8 | sb.append(SPECIFICATION_VERSION);↵ | |
9 | sb.append(brace);↵ | 9 | sb.append(brace);↵ | |
10 | sb.append(specificationVersion);↵ | 10 | sb.append(specificationVersion);↵ | |
11 | sb.append(StringUtils.LINE_SEP);↵ | 11 | sb.append(StringUtils.LINE_SEP);↵ | |
12 | }↵ | 12 | }↵ | |
13 | if (null != specificationVendor) {↵ | 13 | if (null != specificationVendor) {↵ | |
14 | sb.append(SPECIFICATION_VENDOR);↵ | 14 | sb.append(SPECIFICATION_VENDOR);↵ | |
15 | sb.append(brace);↵ | 15 | sb.append(brace);↵ | |
16 | sb.append(specificationVendor);↵ | 16 | sb.append(specificationVendor);↵ | |
17 | sb.append(StringUtils.LINE_SEP);↵ | 17 | sb.append(StringUtils.LINE_SEP);↵ | |
18 | }↵ | 18 | }↵ | |
19 | if (null != implementationVersion) {↵ | 19 | if (null != implementationTitle) {↵ | |
20 | sb.append(IMPLEMENTATION_VERSION);↵ | 20 | sb.append(IMPLEMENTATION_TITLE);↵ | |
21 | sb.append(brace);↵ | 21 | sb.append(brace);↵ | |
22 | sb.append(implementationVersion);↵ | 22 | sb.append(implementationTitle);↵ | |
23 | sb.append(StringUtils.LINE_SEP);↵ | 23 | sb.append(StringUtils.LINE_SEP);↵ | |
24 | }↵ | 24 | }↵ | |
25 | if (null != implementationVendorID) {↵ | 25 | if (null != implementationVersion) {↵ | |
26 | sb.append(IMPLEMENTATION_VENDOR_ID);↵ | 26 | sb.append(IMPLEMENTATION_VERSION);↵ | |
27 | sb.append(brace);↵ | 27 | sb.append(brace);↵ | |
28 | sb.append(implementationVendorID);↵ | 28 | sb.append(implementationVersion);↵ | |
29 | sb.append(StringUtils.LINE_SEP);↵ | 29 | sb.append(StringUtils.LINE_SEP);↵ | |
30 | }↵ | 30 | }↵ | |
31 | if (null != implementationVendor) {↵ | 31 | if (null != implementationVendor) {↵ | |
32 | sb.append(IMPLEMENTATION_VENDOR);↵ | 32 | sb.append(IMPLEMENTATION_VENDOR);↵ | |
33 | sb.append(brace);↵ | 33 | sb.append(brace);↵ | |
34 | sb.append(implementationVendor);↵ | 34 | sb.append(implementationVendor);↵ | |
35 | sb.append(StringUtils.LINE_SEP);↵ | 35 | sb.append(StringUtils.LINE_SEP);↵ | |
36 | }↵ | 36 | }↵ | |
37 | if (null != implementationURL) {↵ | |||
38 | sb.append(IMPLEMENTATION_URL);↵ | |||
39 | sb.append(brace);↵ | |||
40 | sb.append(implementationURL);↵ | |||
41 | sb.append(StringUtils.LINE_SEP);↵ | |||
42 | }↵ | |||
43 | return sb.toString(); | 37 |
| |
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) | 10.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 410 |
Number of mapped statements | 31 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 477.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final String brace = ": "; | 1 | final String brace = ": "; | ||||||||||||
2 | final StringBuffer sb = new StringBuffer(EXTENSION_NAME.toString()); |
| 2 | final StringBuffer sb = new StringBuffer(SPECIFICATION_TITLE.toString()); | |||||||||||
3 | sb.append(brace); | 3 | sb.append(brace); | ||||||||||||
4 | sb.append(extensionName); |
| 4 | sb.append(specificationTitle); | |||||||||||
5 | sb.append(StringUtils.LINE_SEP); | 5 | sb.append(StringUtils.LINE_SEP); | ||||||||||||
6 | if (null != specificationVersion) | 6 | if (null != specificationVersion) | ||||||||||||
7 | sb.append(SPECIFICATION_VERSION); | 7 | sb.append(SPECIFICATION_VERSION); | ||||||||||||
8 | sb.append(brace); | 8 | sb.append(brace); | ||||||||||||
9 | sb.append(specificationVersion); | 9 | sb.append(specificationVersion); | ||||||||||||
10 | sb.append(StringUtils.LINE_SEP); | 10 | sb.append(StringUtils.LINE_SEP); | ||||||||||||
11 | if (null != specificationVendor) | 11 | if (null != specificationVendor) | ||||||||||||
12 | sb.append(SPECIFICATION_VENDOR); | 12 | sb.append(SPECIFICATION_VENDOR); | ||||||||||||
13 | sb.append(brace); | 13 | sb.append(brace); | ||||||||||||
14 | sb.append(specificationVendor); | 14 | sb.append(specificationVendor); | ||||||||||||
15 | sb.append(StringUtils.LINE_SEP); | 15 | sb.append(StringUtils.LINE_SEP); | ||||||||||||
16 | if (null != implementationVersion) |
| 21 | if (null != implementationVersion) | |||||||||||
17 | sb.append(IMPLEMENTATION_VERSION); | 22 | sb.append(IMPLEMENTATION_VERSION); | ||||||||||||
18 | sb.append(brace); | 23 | sb.append(brace); | ||||||||||||
19 | sb.append(implementationVersion); |
| 24 | sb.append(implementationVersion); | |||||||||||
20 | sb.append(StringUtils.LINE_SEP); | 25 | sb.append(StringUtils.LINE_SEP); | ||||||||||||
21 | if (null != implementationVendorID) |
| 26 | if (null != implementationVendor) | |||||||||||
22 | sb.append(IMPLEMENTATION_VENDOR_ID); |
| 27 | sb.append(IMPLEMENTATION_VENDOR); | |||||||||||
23 | sb.append(brace); | 28 | sb.append(brace); | ||||||||||||
24 | sb.append(implementationVendorID); |
| 29 | sb.append(implementationVendor); | |||||||||||
25 | sb.append(StringUtils.LINE_SEP); | 30 | sb.append(StringUtils.LINE_SEP); | ||||||||||||
26 | if (null != implementationVendor) |
| 16 | if (null != implementationTitle) | |||||||||||
27 | sb.append(IMPLEMENTATION_VENDOR); |
| 17 | sb.append(IMPLEMENTATION_TITLE); | |||||||||||
28 | sb.append(brace); | 18 | sb.append(brace); | ||||||||||||
29 | sb.append(implementationVendor); |
| 19 | sb.append(implementationTitle); | |||||||||||
30 | sb.append(StringUtils.LINE_SEP); | 20 | sb.append(StringUtils.LINE_SEP); | ||||||||||||
31 | if (null != implementationURL) | | |||||||||||||
32 | sb.append(IMPLEMENTATION_URL); | | |||||||||||||
33 | sb.append(brace); | | |||||||||||||
34 | sb.append(implementationURL); | | |||||||||||||
35 | sb.append(StringUtils.LINE_SEP); |
| | ||||||||||||
36 | return sb.toString(); | 31 | return sb.toString(); |
Row | Violation |
---|---|
1 | Type org.apache.tools.ant.taskdefs.optional.extension.DeweyDecimal of variable implementationVersion does not match with type java.lang.String of variable implementationVersion |
2 | Type org.apache.tools.ant.taskdefs.optional.extension.DeweyDecimal of variable implementationVersion does not match with type java.lang.String of variable implementationVersion |
3 | Unmatched statement sb.append(StringUtils.LINE_SEP); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Clone fragment #1 returns variables sb, brace , while Clone fragment #2 returns variables |