if (itemLabelProvider != null)
{
// And delegate the call.
//
return itemLabelProvider.getText(object);
}
// If there is a column object, just convert it to a string.
//
else if (object != null)
{
return object.toString();
}
else
{
return "";
}
if (itemLabelProvider != null)
{
// And delegate the call.
//
return itemLabelProvider.getText(object);
}
// If there is a column object, just convert it to a string.
//
else if (object != null)
{
return object.toString();
}
else
{
return "";
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/AdapterFactoryItemDelegator.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/AdapterFactoryLabelProvider.java
|
Method name: String getColumnText(Object, int)
|
|
Method name: String getColumnText(Object, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (itemLabelProvider != null)↵ | | 1 | if (itemLabelProvider != null)↵
|
2 | {↵ | | 2 | {↵
|
3 | // And delegate the call.↵ | | 3 | // And delegate the call.↵
|
4 | //↵ | | 4 | //↵
|
5 | return itemLabelProvider.getText(object);↵ | | 5 | return itemLabelProvider.getText(object);↵
|
6 | }↵ | | 6 | }↵
|
7 | // If there is a column object, just convert it to a string.↵ | | 7 | // If there is a column object, just convert it to a string.↵
|
8 | //↵ | | 8 | //↵
|
9 | else if (object != null)↵ | | 9 | else if (object != null)↵
|
10 | {↵ | | 10 | {↵
|
11 | return object.toString();↵ | | 11 | return object.toString();↵
|
12 | }↵ | | 12 | }↵
|
13 | else↵ | | 13 | else↵
|
14 | {↵ | | 14 | {↵
|
15 | return "";↵ | | 15 | return "";↵
|
16 | } | | 16 | }
|
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 in different classes |
Number of node comparisons | 21 |
-
{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) | 0.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | if (itemLabelProvider != null) | | 5 | if (itemLabelProvider != null) |
6 | return itemLabelProvider.getText(object); | | 6 | return itemLabelProvider.getText(object); |
7 | | | 7 | |
8 | return object.toString(); | | 8 | return object.toString(); |
| | | | |
9 | | | 9 | |
Precondition Violations (0)
Row |
Violation |