for (InternalEObject parent = (InternalEObject)eObject; parent != null; parent = parent.eInternalContainer())
{
Resource resource = parent.eDirectResource();
if (resource != null && resource.getResourceSet() == ancestorResourceSet)
{
return true;
}
}
return false;
for (InternalEObject parent = (InternalEObject)eObject; parent != null; parent = parent.eInternalContainer())
{
if (parent.eDirectResource() == ancestorResource)
{
return true;
}
}
return false;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreUtil.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreUtil.java
|
Method name: boolean isAncestor(ResourceSet, EObject)
|
|
Method name: boolean isAncestor(Resource, EObject)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | for (InternalEObject parent = (InternalEObject)eObject; parent != null; parent = parent.eInternalContainer())↵ | | 1 | for (InternalEObject parent = (InternalEObject)eObject; parent != null; parent = parent.eInternalContainer())↵
|
2 | {↵ | | 2 | {↵
|
3 | Resource resource = parent.eDirectResource();↵ | | 3 | if (parent.eDirectResource()↵
|
4 | if (resource != null && resource.getResourceSet() == ancestorResourceSet)↵ | | 4 | == ancestorResource)↵
|
5 | {↵ | | 5 | {↵
|
6 | return true;↵ | | 6 | return true;↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | return false; | | 9 | return false;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 1 |