switch (((XMLGregorianCalendar)calendar1).compare((XMLGregorianCalendar)calendar2))
{
case DatatypeConstants.EQUAL:
{
return EQUALS;
}
case DatatypeConstants.LESSER:
{
return LESS_THAN;
}
case DatatypeConstants.GREATER:
{
return GREATER_THAN;
}
default:
{
return INDETERMINATE;
}
}
switch (((Duration)duration1).compare((Duration)duration2))
{
case DatatypeConstants.EQUAL:
{
return EQUALS;
}
case DatatypeConstants.LESSER:
{
return LESS_THAN;
}
case DatatypeConstants.GREATER:
{
return GREATER_THAN;
}
default:
{
return INDETERMINATE;
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeUtil.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeUtil.java
|
Method name: int compareCalendar(Object, Object)
|
|
Method name: int compareDuration(Object, Object)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | switch (((XMLGregorianCalendar)calendar1).compare((XMLGregorianCalendar)calendar2))↵ | | 1 | switch (((Duration)duration1).compare((Duration)duration2))↵
|
2 | {↵ | | 2 | {↵
|
3 | case DatatypeConstants.EQUAL:↵ | | 3 | case DatatypeConstants.EQUAL:↵
|
4 | {↵ | | 4 | {↵
|
5 | return EQUALS;↵ | | 5 | return EQUALS;↵
|
6 | }↵ | | 6 | }↵
|
7 | case DatatypeConstants.LESSER:↵ | | 7 | case DatatypeConstants.LESSER:↵
|
8 | {↵ | | 8 | {↵
|
9 | return LESS_THAN;↵ | | 9 | return LESS_THAN;↵
|
10 | }↵ | | 10 | }↵
|
11 | case DatatypeConstants.GREATER:↵ | | 11 | case DatatypeConstants.GREATER:↵
|
12 | {↵ | | 12 | {↵
|
13 | return GREATER_THAN;↵ | | 13 | return GREATER_THAN;↵
|
14 | }↵ | | 14 | }↵
|
15 | default:↵ | | 15 | default:↵
|
16 | {↵ | | 16 | {↵
|
17 | return INDETERMINATE;↵ | | 17 | return INDETERMINATE;↵
|
18 | }↵ | | 18 | }↵
|
19 | } | | 19 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 41 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 9 |
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.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | switch (((XMLGregorianCalendar)calendar1).compare((XMLGregorianCalendar)calendar2)) | | 1 | switch (((Duration)duration1).compare((Duration)duration2)) |
2 | case DatatypeConstants.EQUAL: | | 2 | case DatatypeConstants.EQUAL: |
3 | | | 3 | |
4 | case DatatypeConstants.LESSER: | | 4 | case DatatypeConstants.LESSER: |
5 | | | 5 | |
6 | case DatatypeConstants.GREATER: | | 6 | case DatatypeConstants.GREATER: |
7 | | | 7 | |
8 | | | 8 | |
9 | | | 9 | |
Precondition Violations (2)
Row |
Violation |
1 | Type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)calendar2 does not match with type javax.xml.datatype.Duration of variable (Duration)duration2 |
2 | Type javax.xml.datatype.XMLGregorianCalendar of variable (XMLGregorianCalendar)calendar1 does not match with type javax.xml.datatype.Duration of variable (Duration)duration1 |