File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLString.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLString.java | |||
Method name: void saveNilElement(String)
|
Method name: void saveDataValueElement(String, String)
|
|||
Number of AST nodes: 20 | Number of AST nodes: 20 | |||
1 | if (lastElementIsStart)↵ | 1 | if (lastElementIsStart)↵ | |
2 | {↵ | 2 | {↵ | |
3 | closeStartElement();↵ | 3 | closeStartElement();↵ | |
4 | }↵ | 4 | }↵ | |
5 | saveDoctype(name);↵ | 5 | saveDoctype(name);↵ | |
6 | ++depth;↵ | 6 | ++depth;↵ | |
7 | if (!isMixed)↵ | 7 | if (!isMixed)↵ | |
8 | {↵ | 8 | {↵ | |
9 | add(getElementIndent());↵ | 9 | add(getElementIndent());↵ | |
10 | }↵ | 10 | }↵ | |
11 | add("<");↵ | 11 | add("<");↵ | |
12 | add(name);↵ | 12 | add(name);↵ | |
13 | if (firstElementMark == null)↵ | 13 | if (firstElementMark == null)↵ | |
14 | {↵ | 14 | {↵ | |
15 | firstElementMark = mark();↵ | 15 | firstElementMark = mark();↵ | |
16 | startFileBuffering();↵ | 16 | startFileBuffering();↵ | |
17 | }↵ | 17 | }↵ | |
18 | if (currentLineWidth > lineWidth)↵ | 18 | ↵ | |
19 | {↵ | |||
20 | addLine(↵ | 19 | add(">");↵ | |
21 | );↵ | 20 | add(content);↵ | |
22 | add(getAttributeIndent());↵ | 21 | add(↵ | |
23 | }↵ | |||
24 | else↵ | |||
25 | {↵ | |||
26 | add(" ");↵ | |||
27 | }↵ | |||
28 | add("xsi:nil=\"true\"/>");↵ | |||
29 | --depth;↵ | |||
22 | "</");↵ | |||
23 | --depth;↵ | |||
24 | add(name);↵ | |||
25 | add(">");↵ | |||
30 | if (!isUnformatted && !isMixed)↵ | 26 | if (!isUnformatted && !isMixed)↵ | |
31 | {↵ | 27 | {↵ | |
32 | addLine();↵ | 28 | addLine();↵ | |
33 | }↵ | 29 | }↵ | |
34 | lastElementIsStart = false; | 30 |
| |
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 138 |
Number of mapped statements | 16 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 22.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (lastElementIsStart) | 1 | if (lastElementIsStart) | |||||||||||
2 | closeStartElement(); | 2 | closeStartElement(); | |||||||||||
3 | saveDoctype(name); | 3 | saveDoctype(name); | |||||||||||
4 | ++depth; | 4 | ++depth; | |||||||||||
5 | if (!isMixed) | 5 | if (!isMixed) | |||||||||||
6 | add(getElementIndent()); | 6 | add(getElementIndent()); | |||||||||||
7 | add("<"); | 7 | add("<"); | |||||||||||
8 | add(name); | 8 | add(name); | |||||||||||
9 | if (firstElementMark == null) | 9 | if (firstElementMark == null) | |||||||||||
10 | firstElementMark = mark(); | 10 | firstElementMark = mark(); | |||||||||||
11 | startFileBuffering(); | 11 | startFileBuffering(); | |||||||||||
| 12 | add(">"); | ||||||||||||
12 | if (currentLineWidth > lineWidth) | | ||||||||||||
13 | addLine(); | | ||||||||||||
14 | add(getAttributeIndent()); |
| | |||||||||||
else | | |||||||||||||
15 | add(" "); |
| | |||||||||||
| 13 | add(content); | ||||||||||||
|
| 14 | add("</"); | |||||||||||
16 | add("xsi:nil=\"true\"/>"); |
| 16 | add(name); | ||||||||||
17 | --depth; | 15 | --depth; | |||||||||||
|
| 17 | add(">"); | |||||||||||
18 | if (!isUnformatted && !isMixed) | 18 | if (!isUnformatted && !isMixed) | |||||||||||
19 | addLine(); | 19 | addLine(); | |||||||||||
20 | lastElementIsStart = false; | 20 | lastElementIsStart = false; |
Row | Violation |
---|---|
1 | Unmatched statement add(getAttributeIndent()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement add(" "); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement add("</"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement add(">"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |