if ( persister.hasCache() ) {
ck = new CacheKey(
id,
persister.getIdentifierType(),
persister.getRootEntityName(),
session.getEntityMode(),
session.getFactory()
);
lock = persister.getCacheAccessStrategy().lockItem( ck, version );
}
else {
ck = null;
}
if ( persister.hasCache() ) {
ck = new CacheKey(
id,
persister.getIdentifierType(),
persister.getRootEntityName(),
session.getEntityMode(),
session.getFactory()
);
lock = persister.getCacheAccessStrategy().lockItem( ck, previousVersion );
}
else {
ck = null;
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/EntityDeleteAction.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/EntityUpdateAction.java
|
Method name: void execute()
|
|
Method name: void execute()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if ( persister.hasCache() ) {↵ | | 1 | if ( persister.hasCache() ) {↵
|
2 | ck = new CacheKey( ↵ | | 2 | ck = new CacheKey( ↵
|
3 | id, ↵ | | 3 | id, ↵
|
4 | persister.getIdentifierType(), ↵ | | 4 | persister.getIdentifierType(), ↵
|
5 | persister.getRootEntityName(), ↵ | | 5 | persister.getRootEntityName(), ↵
|
6 | session.getEntityMode(), ↵ | | 6 | session.getEntityMode(), ↵
|
7 | session.getFactory() ↵ | | 7 | session.getFactory() ↵
|
8 | );↵ | | 8 | );↵
|
9 | lock = persister.getCacheAccessStrategy().lockItem( ck, version );↵ | | 9 | lock = persister.getCacheAccessStrategy().lockItem( ck, previousVersion );↵
|
10 | }↵ | | 10 | }↵
|
11 | else {↵ | | 11 | else {↵
|
12 | ck = null;↵ | | 12 | ck = null;↵
|
13 | } | | 13 | }
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | if (persister.hasCache()) | | 11 | if (persister.hasCache()) |
11 | ck = new CacheKey(id, persister.getIdentifierType(), persister.getRootEntityName(), session.getEntityMode(), session.getFactory()); | | 12 | ck = new CacheKey(id, persister.getIdentifierType(), persister.getRootEntityName(), session.getEntityMode(), session.getFactory()); |
12 | lock = persister.getCacheAccessStrategy().lockItem(ck, version); | | 13 | lock = persister.getCacheAccessStrategy().lockItem(ck, previousVersion); |
| | | | |
13 | | | 14 | |
Precondition Violations (0)
Row |
Violation |