if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
ccs = new NonstrictReadWriteCache();
}
else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
ccs = new TransactionalCache();
}
else {
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
}
if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
ccs = new NonstrictReadWriteCache();
}
else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
ccs = new TransactionalCache();
}
else {
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/impl/bridge/CollectionRegionAdapter.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/impl/bridge/EntityRegionAdapter.java
|
Method name: CollectionRegionAccessStrategy buildAccessStrategy(AccessType)
|
|
Method name: EntityRegionAccessStrategy buildAccessStrategy(AccessType)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {↵ | | 1 | if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {↵
|
2 | ccs = new NonstrictReadWriteCache();↵ | | 2 | ccs = new NonstrictReadWriteCache();↵
|
3 | }↵ | | 3 | }↵
|
4 | else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {↵ | | 4 | else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {↵
|
5 | ccs = new TransactionalCache();↵ | | 5 | ccs = new TransactionalCache();↵
|
6 | }↵ | | 6 | }↵
|
7 | else {↵ | | 7 | else {↵
|
8 | throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );↵ | | 8 | throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 0.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | else if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) | | 8 | else if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) |
9 | ccs = new NonstrictReadWriteCache(); | | 9 | ccs = new NonstrictReadWriteCache(); |
10 | else if (AccessType.TRANSACTIONAL.equals(accessType)) | | 10 | else if (AccessType.TRANSACTIONAL.equals(accessType)) |
11 | ccs = new TransactionalCache(); | | 11 | ccs = new TransactionalCache(); |
| | | | |
12 | throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]"); | | 12 | throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]"); |
Precondition Violations (0)
Row |
Violation |