if ( !isOperationQueueEnabled() ) {
write();
return list.add(object);
}
else {
queueOperation( new SimpleAdd(object) );
return true;
}
if ( !isOperationQueueEnabled() ) {
write();
return bag.add(object);
}
else {
queueOperation( new SimpleAdd(object) );
return true;
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentList.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentBag.java
|
Method name: boolean add(Object)
|
|
Method name: boolean add(Object)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( !isOperationQueueEnabled() ) {↵ | | 1 | if ( !isOperationQueueEnabled() ) {↵
|
2 | write();↵ | | 2 | write();↵
|
3 | return list.add(object);↵ | | 3 | return bag.add(object);↵
|
4 | }↵ | | 4 | }↵
|
5 | else {↵ | | 5 | else {↵
|
6 | queueOperation( new SimpleAdd(object) );↵ | | 6 | queueOperation( new SimpleAdd(object) );↵
|
7 | return true;↵ | | 7 | return true;↵
|
8 | } | | 8 | }
|
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 in different classes having the same super class |
Number of node comparisons | 25 |
-
{Non-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) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (!isOperationQueueEnabled()) | | 1 | if (!isOperationQueueEnabled()) |
2 | | | 2 | |
3 | | | 3 | |
| | | | |
4 | queueOperation(new SimpleAdd(object)); | | 4 | queueOperation(new SimpleAdd(object)); |
5 | | | 5 | |
Precondition Violations (1)
Row |
Violation |
1 | Type org.hibernate.collection.PersistentList.SimpleAdd of variable new SimpleAdd(object) does not match with type org.hibernate.collection.PersistentBag.SimpleAdd of variable new SimpleAdd(object) |