if (initialValue == null)
{
return null;
}
char charValue = 0;
try
{
Integer value = new Integer(initialValue);
charValue = (char) value.intValue();
}
catch (NumberFormatException e)
{
char[] carray = initialValue.toCharArray();
charValue = carray[0];
}
return new Character(charValue);
if (initialValue == null)
{
return null;
}
char charValue = 0;
try
{
Integer value = new Integer(initialValue);
charValue = (char) value.intValue();
}
catch (NumberFormatException e)
{
char[] carray = initialValue.toCharArray();
charValue = carray[0];
}
return new Character(charValue);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java
|
Method name: Character createECharacterObjectFromString(EDataType, String)
|
|
Method name: Character createECharFromString(EDataType, String)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (initialValue == null)↵ | | 1 | if (initialValue == null)↵
|
2 | {↵ | | 2 | {↵
|
3 | return null;↵ | | 3 | return null;↵
|
4 | }↵ | | 4 | }↵
|
|
5 | char charValue = 0;↵ | | 5 | char charValue = 0;↵
|
6 | try↵ | | 6 | try↵
|
7 | {↵ | | 7 | {↵
|
8 | Integer value = new Integer(initialValue);↵ | | 8 | Integer value = new Integer(initialValue);↵
|
9 | charValue = (char) value.intValue();↵ | | 9 | charValue = (char) value.intValue();↵
|
10 | }↵ | | 10 | }↵
|
11 | catch (NumberFormatException e)↵ | | 11 | catch (NumberFormatException e)↵
|
12 | {↵ | | 12 | {↵
|
13 | char[] carray = initialValue.toCharArray();↵ | | 13 | char[] carray = initialValue.toCharArray();↵
|
14 | charValue = carray[0];↵ | | 14 | charValue = carray[0];↵
|
15 | }↵ | | 15 | }↵
|
16 | return new Character(charValue); | | 16 | return new Character(charValue);
|
See real code fragment |
|
See real code fragment |
Summary
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 24 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 1.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (initialValue == null) | | 1 | if (initialValue == null) |
2 | | | 2 | |
3 | char charValue = 0; | | 3 | char charValue = 0; |
4 | try | | 4 | try |
5 | Integer value = new Integer(initialValue); | | 5 | Integer value = new Integer(initialValue); |
6 | charValue = (char)value.intValue(); | | 6 | charValue = (char)value.intValue(); |
7 | return new Character(charValue); | | 7 | return new Character(charValue); |
Precondition Violations (0)
Row |
Violation |