if (feature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)feature))
{
FeatureMap.Entry entry = (FeatureMap.Entry)child;
feature = entry.getEStructuralFeature();
child = entry.getValue();
}
String childType = feature instanceof EAttribute ? getTypeText((EAttribute)feature) : getTypeText(child);
if (feature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)feature))
{
FeatureMap.Entry entry = (FeatureMap.Entry)child;
feature = entry.getEStructuralFeature();
child = entry.getValue();
}
String childType = feature instanceof EAttribute ? getTypeText((EAttribute)feature) : getTypeText(child);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java
|
Method name: String getCreateChildDescription(Object, Object, Object, Collection>)
|
|
Method name: String getCreateChildToolTipText(Object, Object, Object, Collection>)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (feature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)feature))↵ | | 1 | if (feature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)feature))↵
|
2 | {↵ | | 2 | {↵
|
3 | FeatureMap.Entry entry = (FeatureMap.Entry)child;↵ | | 3 | FeatureMap.Entry entry = (FeatureMap.Entry)child;↵
|
4 | feature = entry.getEStructuralFeature();↵ | | 4 | feature = entry.getEStructuralFeature();↵
|
5 | child = entry.getValue();↵ | | 5 | child = entry.getValue();↵
|
6 | }↵ | | 6 | }↵
|
|
7 | String childType = feature instanceof EAttribute ? getTypeText((EAttribute)feature) : getTypeText(child); | | 7 | String childType = feature instanceof EAttribute ? getTypeText((EAttribute)feature) : getTypeText(child);
|
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 | 17 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (feature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)feature)) | | 1 | if (feature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)feature)) |
2 | FeatureMap.Entry entry = (FeatureMap.Entry)child; | | 2 | FeatureMap.Entry entry = (FeatureMap.Entry)child; |
3 | feature = entry.getEStructuralFeature(); | | 3 | feature = entry.getEStructuralFeature(); |
4 | child = entry.getValue(); | | 4 | child = entry.getValue(); |
5 | String childType = feature instanceof EAttribute ? getTypeText((EAttribute)feature) : getTypeText(child); | | 5 | String childType = feature instanceof EAttribute ? getTypeText((EAttribute)feature) : getTypeText(child); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables feature, childType , while Clone fragment #2 returns variables feature, childType |