if (this.adapterFactory instanceof IChangeNotifier)
{
((IChangeNotifier)this.adapterFactory).removeListener(this);
}
if (adapterFactory instanceof IChangeNotifier)
{
((IChangeNotifier)adapterFactory).addListener(this);
}
this.adapterFactory = adapterFactory;
if (this.adapterFactory instanceof IChangeNotifier)
{
((IChangeNotifier)this.adapterFactory).removeListener(this);
}
if (adapterFactory instanceof IChangeNotifier)
{
((IChangeNotifier)adapterFactory).addListener(this);
}
this.adapterFactory = adapterFactory;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/AdapterFactoryContentProvider.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/AdapterFactoryLabelProvider.java
|
Method name: void setAdapterFactory(AdapterFactory)
|
|
Method name: void setAdapterFactory(AdapterFactory)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (this.adapterFactory instanceof IChangeNotifier)↵ | | 1 | if (this.adapterFactory instanceof IChangeNotifier)↵
|
2 | {↵ | | 2 | {↵
|
3 | ((IChangeNotifier)this.adapterFactory).removeListener(this);↵ | | 3 | ((IChangeNotifier)this.adapterFactory).removeListener(this);↵
|
4 | }↵ | | 4 | }↵
|
|
5 | if (adapterFactory instanceof IChangeNotifier)↵ | | 5 | if (adapterFactory instanceof IChangeNotifier)↵
|
6 | {↵ | | 6 | {↵
|
7 | ((IChangeNotifier)adapterFactory).addListener(this);↵ | | 7 | ((IChangeNotifier)adapterFactory).addListener(this);↵
|
8 | }↵ | | 8 | }↵
|
|
9 | this.adapterFactory = adapterFactory; | | 9 | this.adapterFactory = adapterFactory;
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 14 |
-
{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 |
1 | if (this.adapterFactory instanceof IChangeNotifier) | | 1 | if (this.adapterFactory instanceof IChangeNotifier) |
2 | ((IChangeNotifier)this.adapterFactory).removeListener(this); | | 2 | ((IChangeNotifier)this.adapterFactory).removeListener(this); |
3 | if (adapterFactory instanceof IChangeNotifier) | | 3 | if (adapterFactory instanceof IChangeNotifier) |
4 | ((IChangeNotifier)adapterFactory).addListener(this); | | 4 | ((IChangeNotifier)adapterFactory).addListener(this); |
5 | this.adapterFactory = adapterFactory; | | 5 | this.adapterFactory = adapterFactory; |
Precondition Violations (0)
Row |
Violation |