File path: /emf-2.4.1/src/org/eclipse/emf/common/util/DelegatingEList.java | File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java | |||
Method name: Collection
|
Method name: Collection
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (collection.isEmpty())↵ | 1 | if (collection.isEmpty())↵ | |
2 | {↵ | 2 | {↵ | |
3 | return ECollections.emptyEList();↵ | 3 | return ECollections.emptyEList();↵ | |
4 | }↵ | 4 | }↵ | |
5 | else↵ | 5 | else↵ | |
6 | {↵ | 6 | {↵ | |
7 | Collection<E> filteredResult = useEquals() ? new BasicEList<E>(collection.size()) : new BasicEList.FastCompare<E>(collection.size());↵ | 7 | Collection<E> filteredResult = useEquals() ? new BasicEList<E>(collection.size()) : new FastCompare<E>(collection.size());↵ | |
8 | for (E object : this)↵ | 8 | for (E object : this)↵ | |
9 | {↵ | 9 | {↵ | |
10 | if (collection.contains(object))↵ | 10 | if (collection.contains(object))↵ | |
11 | {↵ | 11 | {↵ | |
12 | filteredResult.add(object);↵ | 12 | filteredResult.add(object);↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | return filteredResult;↵ | 15 | return filteredResult;↵ | |
16 | } | 16 |
| |
See real code fragment | See real code fragment |
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 in different classes having the same super class |
Number of node comparisons | 21 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (collection.isEmpty()) |
| 1 | if (collection.isEmpty()) | |||||||||||
2 | return ECollections.emptyEList(); | 2 | return ECollections.emptyEList(); | ||||||||||||
else | else | ||||||||||||||
|
| 3 | Collection<E> filteredResult = useEquals() ? new BasicEList<E>(collection.size()) : new FastCompare<E>(collection.size()); | ||||||||||||
3 | Collection<E> filteredResult = useEquals() ? new BasicEList<E>(collection.size()) : new BasicEList.FastCompare<E>(collection.size()); |
| | ||||||||||||
4 | for (E object : this) | 4 | for (E object : this) | ||||||||||||
5 | if (collection.contains(object)) |
| 5 | if (collection.contains(object)) | |||||||||||
6 | filteredResult.add(object); | 6 | filteredResult.add(object); | ||||||||||||
7 | return filteredResult; | 7 | return filteredResult; |
Row | Violation |
---|---|
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
2 | Unmatched statement Collection<E> filteredResult=useEquals() ? new BasicEList<E>(collection.size()) : new FastCompare<E>(collection.size()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement Collection<E> filteredResult=useEquals() ? new BasicEList<E>(collection.size()) : new BasicEList.FastCompare<E>(collection.size()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |