File path: /emf-2.4.1/src/org/eclipse/emf/databinding/EMFUpdateListStrategy.java | File path: /emf-2.4.1/src/org/eclipse/emf/databinding/EMFUpdateListStrategy.java | |||
Method name: IConverter createConverter(Object, Object)
|
Method name: IConverter createConverter(Object, Object)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (toType instanceof EAttribute)↵ | 1 | if (fromType instanceof EAttribute)↵ | |
2 | {↵ | 2 | {↵ | |
3 | final EAttribute eAttribute = (EAttribute)toType;↵ | 3 | final EAttribute eAttribute = (EAttribute)fromType;↵ | |
4 | final EDataType eDataType = eAttribute.getEAttributeType();↵ | 4 | final EDataType eDataType = eAttribute.getEAttributeType();↵ | |
5 | final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance();↵ | 5 | final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance();↵ | |
6 | return↵ | 6 | return↵ | |
7 | new Converter(fromType, toType)↵ | 7 | new Converter(fromType, toType)↵ | |
8 | {↵ | 8 | {↵ | |
9 | public Object convert(Object fromObject)↵ | 9 | public Object convert(Object fromObject)↵ | |
10 | {↵ | 10 | {↵ | |
11 | return eFactory.createFromString(eDataType, (String)fromObject);↵ | 11 | return eFactory.convertToString(eDataType, fromObject);↵ | |
12 | }↵ | 12 | }↵ | |
13 | };↵ | 13 | };↵ | |
14 | } | 14 |
| |
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 26 |
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) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (toType instanceof EAttribute) |
| 8 | if (fromType instanceof EAttribute) | ||||||||||
3 | final EAttribute eAttribute = (EAttribute)toType; |
| 9 | final EAttribute eAttribute = (EAttribute)fromType; | ||||||||||
4 | final EDataType eDataType = eAttribute.getEAttributeType(); | 10 | final EDataType eDataType = eAttribute.getEAttributeType(); | |||||||||||
5 | final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance(); | 11 | final EFactory eFactory = eDataType.getEPackage().getEFactoryInstance(); | |||||||||||
6 | return new Converter(fromType, toType) {...}; | | ||||||||||||
| 12 | return new Converter(fromType, toType) {...}; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables eDataType, eFactory , while Clone fragment #2 returns variables eDataType, eFactory |