int size = readCompressedInt();
InternalEObject[] values = allocateInternalEObjectArray(size);
for (int i = 0; i < size; ++i)
{
values[i] = loadEObject();
}
int size = readCompressedInt();
InternalEObject[] values = allocateInternalEObjectArray(size);
for (int i = 0; i < size; ++i)
{
values[i] = loadEObject();
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/BinaryResourceImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/BinaryResourceImpl.java
|
Method name: void loadResource(Resource)
|
|
Method name: void loadEObjects(InternalEList)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | int size = readCompressedInt();↵ | | 1 | int size = readCompressedInt();↵
|
2 | InternalEObject[] values = allocateInternalEObjectArray(size);↵ | | 2 | InternalEObject[] values = allocateInternalEObjectArray(size);↵
|
3 | for (int i = 0; i < size; ++i)↵ | | 3 | for (int i = 0; i < size; ++i)↵
|
4 | {↵ | | 4 | {↵
|
5 | values[i] = loadEObject();↵ | | 5 | values[i] = loadEObject();↵
|
6 | } | | 6 | }
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | int size = readCompressedInt(); | | 1 | int size = readCompressedInt(); |
7 | InternalEObject[] values = allocateInternalEObjectArray(size); | | 2 | InternalEObject[] values = allocateInternalEObjectArray(size); |
8 | for (int i = 0; i < size; ++i) | | 3 | for (int i = 0; i < size; ++i) |
9 | values[i] = loadEObject(); | | 4 | values[i] = loadEObject(); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables size, values , while Clone fragment #2 returns variables size, values |