File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EFactoryImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EFactoryImpl.java | |||
Method name: String convertToString(EDataType, Object)
|
Method name: Object createFromString(EDataType, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try↵ | 1 | try↵ | |
2 | {↵ | 2 | {↵ | |
3 | String result = EcoreUtil.convertToString(memberType, objectValue);↵ | 3 | Object result = EcoreUtil.createFromString(memberType, stringValue);↵ | |
4 | if (result != null)↵ | 4 | if (result != null)↵ | |
5 | {↵ | 5 | {↵ | |
6 | return result;↵ | 6 | return result;↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | ↵ | |
9 | ↵ | 9 | }↵ | |
10 | catch (Exception e)↵ | 10 | catch (RuntimeException exception)↵ | |
11 | {↵ | 11 | ↵ | |
12 | ↵ | 12 | {↵ | |
13 | // Keep trying until all else false.↵ | 13 | // Keep trying until all else ↵ | |
14 | ↵ | 14 | has failed.↵ | |
15 | } | 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.1 |
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 | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22 | try |
| 30 | try | ||||||||||||||||
23 | String result = EcoreUtil.convertToString(memberType, objectValue); |
| | |||||||||||||||||
|
| 31 | Object result = EcoreUtil.createFromString(memberType, stringValue); | |||||||||||||||||
24 | if (result != null) |
| 32 | if (result != null) | ||||||||||||||||
25 | return result; |
| | |||||||||||||||||
|
| 33 | return result; |
Row | Violation |
---|---|
1 | Unmatched statement String result=EcoreUtil.convertToString(memberType,objectValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Object result=EcoreUtil.createFromString(memberType,stringValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type java.lang.String of variable result does not match with type java.lang.Object of variable result |
4 | Unmatched return result; |
5 | Unmatched return result; |