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/PersistentMap.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 ( ! map.isEmpty() ) {↵ | |
7 | list.clear();↵ | 7 | ↵ | |
8 | dirty↵ | 8 | dirty();↵ | |
9 | ();↵ | 9 | map.clear();↵ | |
10 | }↵ | 10 | }↵ | |
11 | } | 11 |
| |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
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.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (isClearQueueEnabled()) | 1 | if (isClearQueueEnabled()) | |||||||||||||||
2 | queueOperation(new Clear()); |
| 2 | queueOperation(new Clear()); | ||||||||||||||
else | else | |||||||||||||||||
3 | initialize(true); | 3 | initialize(true); | |||||||||||||||
4 | if (!list.isEmpty()) |
| 4 | if (!map.isEmpty()) | ||||||||||||||
5 | list.clear(); |
| 6 | map.clear(); | ||||||||||||||
6 | dirty(); | 5 | dirty(); |
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) |
2 | Type java.util.List of variable list does not match with type java.util.Map of variable map |
3 | Type java.util.List of variable list does not match with type java.util.Map of variable map |