if (theEClass.eContainer() == modelPackage)
{
return doSwitch(theEClass.getClassifierID(), theEObject);
}
else
{
List<EClass> eSuperTypes = theEClass.getESuperTypes();
return
eSuperTypes.isEmpty() ?
defaultCase(theEObject) :
doSwitch(eSuperTypes.get(0), theEObject);
}
if (theEClass.eContainer() == modelPackage)
{
return doSwitch(theEClass.getClassifierID(), theEObject);
}
else
{
List<EClass> eSuperTypes = theEClass.getESuperTypes();
return
eSuperTypes.isEmpty() ?
defaultCase(theEObject) :
doSwitch(eSuperTypes.get(0), theEObject);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/tree/util/TreeSwitch.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/util/MappingSwitch.java
|
Method name: T doSwitch(EClass, EObject)
|
|
Method name: T doSwitch(EClass, EObject)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (theEClass.eContainer() == modelPackage)↵ | | 1 | if (theEClass.eContainer() == modelPackage)↵
|
2 | {↵ | | 2 | {↵
|
3 | return doSwitch(theEClass.getClassifierID(), theEObject);↵ | | 3 | return doSwitch(theEClass.getClassifierID(), theEObject);↵
|
4 | }↵ | | 4 | }↵
|
5 | else↵ | | 5 | else↵
|
6 | {↵ | | 6 | {↵
|
7 | List<EClass> eSuperTypes = theEClass.getESuperTypes();↵ | | 7 | List<EClass> eSuperTypes = theEClass.getESuperTypes();↵
|
8 | return↵ | | 8 | return↵
|
9 | eSuperTypes.isEmpty() ?↵ | | 9 | eSuperTypes.isEmpty() ?↵
|
10 | defaultCase(theEObject) :↵ | | 10 | defaultCase(theEObject) :↵
|
11 | doSwitch(eSuperTypes.get(0), theEObject);↵ | | 11 | doSwitch(eSuperTypes.get(0), theEObject);↵
|
12 | } | | 12 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 16 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (theEClass.eContainer() == modelPackage) | | 1 | if (theEClass.eContainer() == modelPackage) |
2 | return doSwitch(theEClass.getClassifierID(), theEObject); | | 2 | return doSwitch(theEClass.getClassifierID(), theEObject); |
| | | | |
3 | List<EClass> eSuperTypes = theEClass.getESuperTypes(); | | 3 | List<EClass> eSuperTypes = theEClass.getESuperTypes(); |
4 | return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); | | 4 | return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject); |
Precondition Violations (1)
Row |
Violation |
1 | Type org.eclipse.emf.edit.tree.TreePackage of variable modelPackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable modelPackage |