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/PersistentList.java | |||
Method name: Object remove(int)
|
Method name: Object set(int, Object)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (index<0) {↵ | 1 | if (index<0) {↵ | |
2 | throw new ArrayIndexOutOfBoundsException("negative index");↵ | 2 | throw new ArrayIndexOutOfBoundsException("negative index");↵ | |
3 | }↵ | 3 | }↵ | |
4 | Object old = isPutQueueEnabled() ?↵ | 4 | Object old = isPutQueueEnabled() ?↵ | |
5 | readElementByIndex( new Integer(index) ) : UNKNOWN;↵ | 5 | readElementByIndex( new Integer(index) ) : UNKNOWN;↵ | |
6 | if ( old==UNKNOWN ) {↵ | 6 | if ( old==UNKNOWN ) {↵ | |
7 | write();↵ | 7 | write();↵ | |
8 | return list.remove(index);↵ | 8 | return list.set(index, value);↵ | |
9 | }↵ | 9 | }↵ | |
10 | else {↵ | 10 | else {↵ | |
11 | queueOperation( new Remove(index, old) );↵ | 11 | queueOperation( new Set(index, value, old) );↵ | |
12 | return old;↵ | 12 | return old;↵ | |
13 | } | 13 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 41 |
Number of mapped statements | 7 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (index < 0) | 1 | if (index < 0) | ||||||||||||||
2 | throw new ArrayIndexOutOfBoundsException("negative index"); | 2 | throw new ArrayIndexOutOfBoundsException("negative index"); | ||||||||||||||
3 | Object old = isPutQueueEnabled() ? readElementByIndex(new Integer(index)) : UNKNOWN; | 3 | Object old = isPutQueueEnabled() ? readElementByIndex(new Integer(index)) : UNKNOWN; | ||||||||||||||
4 | if (old == UNKNOWN) | 4 | if (old == UNKNOWN) | ||||||||||||||
5 | write(); | 5 | write(); | ||||||||||||||
6 | return list.remove(index); |
| 6 | return list.set(index, value); | |||||||||||||
else | else | ||||||||||||||||
|
| 7 | queueOperation(new Set(index, value, old)); | ||||||||||||||
7 | queueOperation(new Remove(index, old)); |
| | ||||||||||||||
8 | return old; | 8 | return old; |
Row | Violation |
---|---|
1 | Unmatched statement queueOperation(new Set(index,value,old)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement queueOperation(new Remove(index,old)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |