File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/access/AccessType.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/ExecuteUpdateResultCheckStyle.java | |||
Method name: AccessType resolve(String)
|
Method name: ExecuteUpdateResultCheckStyle parse(String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if ( READ_WRITE.name.equals( name ) ) {↵ | 1 | if ( name.equals( NONE.name ) ) {↵ | |
2 | return READ_WRITE;↵ | 2 | return NONE;↵ | |
3 | }↵ | 3 | }↵ | |
4 | else if ( NONSTRICT_READ_WRITE.name.equals( name ) ) {↵ | 4 | else if ( name.equals( COUNT.name ) ) {↵ | |
5 | return NONSTRICT_READ_WRITE;↵ | 5 | return COUNT;↵ | |
6 | }↵ | 6 | }↵ | |
7 | else if ( TRANSACTIONAL.name.equals( name ) ) {↵ | 7 | else if ( name.equals( PARAM.name ) ) {↵ | |
8 | return TRANSACTIONAL;↵ | 8 | return PARAM;↵ | |
9 | }↵ | 9 | }↵ | |
10 | else {↵ | 10 | else {↵ | |
11 | return null;↵ | 11 | return null;↵ | |
12 | } | 12 |
| |
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.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 36 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (READ_WRITE.name.equals(name)) |
| 1 | if (name.equals(NONE.name)) | |||||||||||||
|
| 2 | return NONE; | ||||||||||||||
4 | return READ_WRITE; |
| | ||||||||||||||
5 | else if (NONSTRICT_READ_WRITE.name.equals(name)) |
| 3 | else if (name.equals(COUNT.name)) | |||||||||||||
|
| 4 | return COUNT; | ||||||||||||||
6 | return NONSTRICT_READ_WRITE; |
| | ||||||||||||||
7 | else if (TRANSACTIONAL.name.equals(name)) |
| 5 | else if (name.equals(PARAM.name)) | |||||||||||||
|
| 6 | return PARAM; | ||||||||||||||
8 | return TRANSACTIONAL; |
| | ||||||||||||||
else | else | ||||||||||||||||
9 | return null; | 7 | return null; |
Row | Violation |
---|---|
1 | Unmatched statement return NONE; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return NONE; |
3 | Unmatched statement return READ_WRITE; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return READ_WRITE; |
5 | Unmatched statement return COUNT; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched return COUNT; |
7 | Unmatched statement return NONSTRICT_READ_WRITE; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched return NONSTRICT_READ_WRITE; |
9 | Unmatched statement return PARAM; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
10 | Unmatched return PARAM; |
11 | Unmatched statement return TRANSACTIONAL; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
12 | Unmatched return TRANSACTIONAL; |
13 | Not all possible execution flows end in a return statement |