File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeValidator.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeValidator.java | |||
Method name: boolean validateNMTOKENSBase_ItemType(List>, DiagnosticChain, Map
|
Method name: boolean validateENTITIESBase_ItemType(List>, DiagnosticChain, Map
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | boolean result = true;↵ | 1 | boolean result = true;↵ | |
2 | for (Iterator<?> i = nmtokensBase.iterator(); i.hasNext() && (result || diagnostics != null); )↵ | 2 | for (Iterator<?> i = entitiesBase.iterator(); i.hasNext() && (result || diagnostics != null); )↵ | |
3 | {↵ | 3 | {↵ | |
4 | Object item = i.next();↵ | 4 | Object item = i.next();↵ | |
5 | if (XMLTypePackage.Literals.NMTOKEN.isInstance(item))↵ | 5 | if (XMLTypePackage.Literals.ENTITY.isInstance(item))↵ | |
6 | {↵ | 6 | {↵ | |
7 | result &= validateNMTOKEN((String)item, diagnostics, context);↵ | 7 | result &= validateENTITY((String)item, diagnostics, context);↵ | |
8 | }↵ | 8 | }↵ | |
9 | else↵ | 9 | else↵ | |
10 | {↵ | 10 | {↵ | |
11 | result = false;↵ | 11 | result = false;↵ | |
12 | reportDataValueTypeViolation(XMLTypePackage.Literals.NMTOKEN, item, diagnostics, context);↵ | 12 | reportDataValueTypeViolation(XMLTypePackage.Literals.ENTITY, item, diagnostics, context);↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | return result; | 15 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 39.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 3 | Object item = i.next(); | |||||||||||||
3 | Object item = i.next(); |
| | |||||||||||||
4 | if (XMLTypePackage.Literals.NMTOKEN.isInstance(item)) |
| 4 | if (XMLTypePackage.Literals.ENTITY.isInstance(item)) | ||||||||||||
5 | result &= validateNMTOKEN((String)item, diagnostics, context); |
| 5 | result &= validateENTITY((String)item, diagnostics, context); | ||||||||||||
else | else | |||||||||||||||
6 | result = false; | 6 | result = false; | |||||||||||||
7 | reportDataValueTypeViolation(XMLTypePackage.Literals.NMTOKEN, item, diagnostics, context); |
| 7 | reportDataValueTypeViolation(XMLTypePackage.Literals.ENTITY, item, diagnostics, context); |
Row | Violation |
---|---|
1 | Unmatched statement Object item=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Object item=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression validateNMTOKEN((String)item,diagnostics,context) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression validateENTITY((String)item,diagnostics,context) cannot be parameterized, because it has dependencies to/from statements that will be extracted |