if (!eClass.getETypeParameters().isEmpty())
{
result.append("<");
for (Iterator<ETypeParameter> i = eClass.getETypeParameters().iterator(); i.hasNext(); )
{
ETypeParameter eTypeParameter = i.next();
result.append(ETypeParameterItemProvider.getText(eTypeParameter));
if (i.hasNext())
{
result.append(", ");
}
}
result.append(">");
}
if (!eDataType.getETypeParameters().isEmpty())
{
result.append("<");
for (Iterator<ETypeParameter> i = eDataType.getETypeParameters().iterator(); i.hasNext(); )
{
ETypeParameter eTypeParameter = i.next();
result.append(ETypeParameterItemProvider.getText(eTypeParameter));
if (i.hasNext())
{
result.append(", ");
}
}
result.append(">");
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EClassItemProvider.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EDataTypeItemProvider.java
|
Method name: String getText(Object)
|
|
Method name: String getText(Object)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if (!eClass.getETypeParameters().isEmpty())↵ | | 1 | if (!eDataType.getETypeParameters().isEmpty())↵
|
2 | {↵ | | 2 | {↵
|
3 | result.append("<");↵ | | 3 | result.append("<");↵
|
4 | for (Iterator<ETypeParameter> i = eClass.getETypeParameters().iterator(); i.hasNext(); )↵ | | 4 | for (Iterator<ETypeParameter> i = eDataType.getETypeParameters().iterator(); i.hasNext(); )↵
|
5 | {↵ | | 5 | {↵
|
6 | ETypeParameter eTypeParameter = i.next();↵ | | 6 | ETypeParameter eTypeParameter = i.next();↵
|
7 | result.append(ETypeParameterItemProvider.getText(eTypeParameter));↵ | | 7 | result.append(ETypeParameterItemProvider.getText(eTypeParameter));↵
|
8 | if (i.hasNext())↵ | | 8 | if (i.hasNext())↵
|
9 | {↵ | | 9 | {↵
|
10 | result.append(", ");↵ | | 10 | result.append(", ");↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
13 | result.append(">");↵ | | 13 | result.append(">");↵
|
14 | } | | 14 | }
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 22 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 13.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | if (!eClass.getETypeParameters().isEmpty()) | | 4 | if (!eDataType.getETypeParameters().isEmpty()) |
6 | | | 5 | |
7 | for (Iterator<ETypeParameter> i = eClass.getETypeParameters().iterator(); i.hasNext(); ) | | 6 | for (Iterator<ETypeParameter> i = eDataType.getETypeParameters().iterator(); i.hasNext(); ) |
8 | ETypeParameter eTypeParameter = i.next(); | | 7 | ETypeParameter eTypeParameter = i.next(); |
9 | result.append(ETypeParameterItemProvider.getText(eTypeParameter)); | | 8 | result.append(ETypeParameterItemProvider.getText(eTypeParameter)); |
10 | | | 9 | |
11 | | | 10 | |
12 | | | 11 | |
Precondition Violations (2)
Row |
Violation |
1 | Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType |
2 | Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType |