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: EDataType basicGetBaseType(EDataType)
|
Method name: EDataType basicGetItemType(EDataType)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | EAnnotation eAnnotation = getAnnotation(eDataType, false);↵ | 1 | EAnnotation eAnnotation = getAnnotation(eDataType, false);↵ | |
2 | if (eAnnotation != null)↵ | 2 | if (eAnnotation != null)↵ | |
3 | {↵ | 3 | {↵ | |
4 | EMap<String, String> details = eAnnotation.getDetails();↵ | 4 | EMap<String, String> details = eAnnotation.getDetails();↵ | |
5 | String baseType = details.get("baseType");↵ | 5 | String itemType = details.get("itemType");↵ | |
6 | if (baseType != null)↵ | 6 | if (itemType != null)↵ | |
7 | {↵ | 7 | {↵ | |
8 | int index = baseType.lastIndexOf("#");↵ | 8 | int index = itemType.lastIndexOf("#");↵ | |
9 | EClassifier type = ↵ | 9 | EClassifier type = ↵ | |
10 | index == -1 ?↵ | 10 | index == -1 ?↵ | |
11 | getType(eDataType.getEPackage(), baseType) :↵ | 11 | getType(eDataType.getEPackage(), itemType) :↵ | |
12 | index == 0 ?↵ | 12 | index == 0 ?↵ | |
13 | getType((String)null, baseType.substring(1)) :↵ | 13 | getType((String)null, itemType.substring(1)) :↵ | |
14 | getType(baseType.substring(0, index), baseType.substring(index + 1));↵ | 14 | getType(itemType.substring(0, index), itemType.substring(index + 1));↵ | |
15 | if (type instanceof EDataType)↵ | 15 | if (type instanceof EDataType)↵ | |
16 | {↵ | 16 | {↵ | |
17 | return (EDataType)type;↵ | 17 | return (EDataType)type;↵ | |
18 | }↵ | 18 | }↵ | |
19 | }↵ | 19 | }↵ | |
20 | }↵ | 20 | }↵ | |
21 | return null; | 21 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | EAnnotation eAnnotation = getAnnotation(eDataType, false); | 1 | EAnnotation eAnnotation = getAnnotation(eDataType, false); | ||||||||||||||||||||
2 | if (eAnnotation != null) | 2 | if (eAnnotation != null) | ||||||||||||||||||||
3 | EMap<String, String> details = eAnnotation.getDetails(); | 3 | EMap<String, String> details = eAnnotation.getDetails(); | ||||||||||||||||||||
4 | String baseType = details.get("baseType"); |
| 4 | String itemType = details.get("itemType"); | |||||||||||||||||||
5 | if (baseType != null) |
| 5 | if (itemType != null) | |||||||||||||||||||
6 | int index = baseType.lastIndexOf("#"); |
| 6 | int index = itemType.lastIndexOf("#"); | |||||||||||||||||||
7 | EClassifier type = index == -1 ? getType(eDataType.getEPackage(), baseType) : index == 0 ? getType((String)null, baseType.substring(1)) : getType(baseType.substring(0, index), baseType.substring(index + 1)); |
| 7 | EClassifier type = index == -1 ? getType(eDataType.getEPackage(), itemType) : index == 0 ? getType((String)null, itemType.substring(1)) : getType(itemType.substring(0, index), itemType.substring(index + 1)); | |||||||||||||||||||
8 | if (type instanceof EDataType) | 8 | if (type instanceof EDataType) | ||||||||||||||||||||
9 | return (EDataType)type; | 9 | return (EDataType)type; | ||||||||||||||||||||
10 | return null; | 10 | return null; |
Row | Violation |
---|