File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java | |||
Method name: EReference getXSISchemaLocationMapFeature(EClass)
|
Method name: EStructuralFeature getAffiliation(EClass, EStructuralFeature)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | List<EReference> eAllReferences = eClass.getEAllReferences();↵ | 1 | List<EStructuralFeature> allElements = getAll↵ | |
2 | Elements(eClass);↵ | |||
2 | for (int i = 0, size = eAllReferences.size(); i < size; ++i)↵ | 3 | for (int i = 0, size = allElements.size(); i < size; ++i)↵ | |
3 | {↵ | 4 | ↵ | |
4 | EReference eReference = eAllReferences.get(i);↵ | |||
5 | if ("xsi:schemaLocation".equals(getName(eReferen↵ | 5 | {↵ | |
6 | EStructuralFeature result = allElements.get(i);↵ | |||
6 | ce)))↵ | 7 | if (matches(getWildcards(result), namespace))↵ | |
7 | {↵ | 8 | ↵ | |
9 | {↵ | |||
8 | return eReference;↵ | 10 | return ↵ | |
9 | }↵ | |||
11 | result;↵ | |||
12 | }↵ | |||
10 | } | 13 | } | |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 2 |
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) | 10.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | List<EReference> eAllReferences = eClass.getEAllReferences(); | | ||||||||||||||||||||||
| 26 | List<EStructuralFeature> allElements = getAllElements(eClass); | ||||||||||||||||||||||
3 | for (int i = 0, size = eAllReferences.size(); i < size; ++i) |
| 27 | for (int i = 0, size = allElements.size(); i < size; ++i) | ||||||||||||||||||||
4 | EReference eReference = eAllReferences.get(i); |
| | |||||||||||||||||||||
|
| 28 | EStructuralFeature result = allElements.get(i); | |||||||||||||||||||||
5 | if ("xsi:schemaLocation".equals(getName(eReference))) |
| 29 | if (matches(getWildcards(result), namespace)) | ||||||||||||||||||||
6 | return eReference; |
| | |||||||||||||||||||||
|
| 30 | return result; |
Row | Violation |
---|---|
1 | Type java.util.List<org.eclipse.emf.ecore.EReference> of variable eAllReferences does not match with type java.util.List<org.eclipse.emf.ecore.EStructuralFeature> of variable allElements |
2 | Unmatched statement EReference eReference=eAllReferences.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement EStructuralFeature result=allElements.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression "xsi:schemaLocation".equals(getName(eReference)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression matches(getWildcards(result),namespace) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression "xsi:schemaLocation".equals(getName(eReference)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression matches(getWildcards(result),namespace) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Unmatched return eReference; |
9 | Unmatched return result; |