if ( isClearQueueEnabled() ) {
queueOperation( new Clear() );
}
else {
initialize( true );
if ( ! list.isEmpty() ) {
list.clear();
dirty();
}
}
if ( isClearQueueEnabled() ) {
queueOperation( new Clear() );
}
else {
initialize( true );
if ( !set.isEmpty() ) {
set.clear();
dirty();
}
}
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/PersistentSet.java
|
Method name: void clear()
|
|
Method name: void clear()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if ( isClearQueueEnabled() ) {↵ | | 1 | if ( isClearQueueEnabled() ) {↵
|
2 | queueOperation( new Clear() );↵ | | 2 | queueOperation( new Clear() );↵
|
3 | }↵ | | 3 | }↵
|
4 | else {↵ | | 4 | else {↵
|
5 | initialize( true );↵ | | 5 | initialize( true );↵
|
6 | if ( ! list.isEmpty() ) {↵ | | 6 | if ( !set.isEmpty() ) {↵
|
7 | list.clear();↵ | | 7 | set.clear();↵
|
8 | dirty();↵ | | 8 | dirty();↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 10 | }
|
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 19.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (isClearQueueEnabled()) | | 1 | if (isClearQueueEnabled()) |
2 | queueOperation(new Clear()); | | 2 | queueOperation(new Clear()); |
| | | | |
3 | | | 3 | |
4 | | | 4 | |
5 | | | 5 | |
6 | | | 6 | |
Precondition Violations (1)
Row |
Violation |
1 | Expression new Clear() cannot be unified with expression new Clear() , because common superclass type org.hibernate.collection.AbstractPersistentCollection.DelayedOperation cannot be passed as an argument to protected final void queueOperation(java.lang.Object) |