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: boolean remove(Object)
|
Method name: boolean add(Object)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if ( exists == null ) {↵ | 1 | if ( exists == null ) {↵ | |
2 | initialize( true );↵ | 2 | initialize( true );↵ | |
3 | if ( list.remove( value ) ) {↵ | 3 | if ( set.add( value ) ) {↵ | |
4 | dirty();↵ | 4 | dirty();↵ | |
5 | return true;↵ | 5 | return true;↵ | |
6 | }↵ | 6 | }↵ | |
7 | else {↵ | 7 | else {↵ | |
8 | return false;↵ | 8 | return false;↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | else if ( exists.booleanValue() ) {↵ | 11 | else if ( exists.booleanValue() ) {↵ | |
12 | ↵ | 12 | return false;↵ | |
13 | }↵ | |||
14 | else {↵ | |||
13 | queueOperation( new SimpleRemove(value) );↵ | 15 | queueOperation( new SimpleAdd(value) );↵ | |
14 | return true;↵ | 16 | return true;↵ | |
15 | }↵ | 17 |
| |
16 | else {↵ | |||
17 | return false;↵ | |||
18 | } | |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 36 |
Number of mapped statements | 9 |
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) | 19.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (exists == null) | 2 | if (exists == null) | |||||||||||||||||
3 | initialize(true); | 3 | initialize(true); | |||||||||||||||||
4 | if (list.remove(value)) |
| 4 | if (set.add(value)) | ||||||||||||||||
5 | dirty(); | 5 | dirty(); | |||||||||||||||||
6 | return true; | 6 | return true; | |||||||||||||||||
else | else | |||||||||||||||||||
7 | return false; | 7 | return false; | |||||||||||||||||
8 | else if (exists.booleanValue()) | 8 | else if (exists.booleanValue()) | |||||||||||||||||
9 | queueOperation(new SimpleRemove(value)); |
| | |||||||||||||||||
10 | return true; |
| 9 | return false; | ||||||||||||||||
else | else | |||||||||||||||||||
|
| 10 | queueOperation(new SimpleAdd(value)); | |||||||||||||||||
11 | return false; |
| 11 | return true; |
Row | Violation |
---|---|
1 | Unmatched statement queueOperation(new SimpleRemove(value)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement queueOperation(new SimpleAdd(value)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |