if ( persister.hasCache() ) {
final CacheKey ck = new CacheKey(
key,
persister.getKeyType(),
persister.getRole(),
session.getEntityMode(),
session.getFactory()
);
persister.getCacheAccessStrategy().unlockItem( ck, lock );
}
if ( !model.isInherited() ) {
IdentifierGenerator generator = model.getIdentifier().createIdentifierGenerator(
settings.getDialect(),
settings.getDefaultCatalogName(),
settings.getDefaultSchemaName(),
(RootClass) model
);
identifierGenerators.put( model.getEntityName(), generator );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/CollectionAction.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
|
Method name: void afterTransactionCompletion(boolean)
|
|
Method name: void SessionFactoryImpl(Configuration, Mapping, Settings, EventListeners, SessionFactoryObserver)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ( persister.hasCache() ) {↵ | | 1 | if ( ↵
|
2 | final CacheKey ck = new CacheKey( ↵ | | |
|
3 | key, ↵ | | |
|
4 | persister.getKeyType↵ | | 2 | !model.isInherited() ) {↵
|
| | | 3 | IdentifierGenerator generator = model.getIdentifier().createIdentifierGenerator(↵
|
5 | (), ↵ | | 4 | settings.getDialect(),↵
|
6 | persister.getRole(), ↵ | | 5 | settings.getDefaultCatalogName(),↵
|
7 | session.getEntityMode(), ↵ | | 6 | settings.getDefaultSchemaName(),↵
|
8 | session.getFactory() ↵ | | 7 | ↵
|
| | | 8 | (RootClass) model↵
|
9 | );↵ | | 9 | );↵
|
10 | persister.getCacheAccessStrategy().unlockItem( ck, lock );↵ | | 10 | identifierGenerators.put( model.getEntityName(), generator );↵
|
11 | } | | 11 | }
|
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 |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 30.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (persister.hasCache()) | | 20 | if (!model.isInherited()) |
2 | final CacheKey ck = new CacheKey(key, persister.getKeyType(), persister.getRole(), session.getEntityMode(), session.getFactory()); | | | |
3 | persister.getCacheAccessStrategy().unlockItem(ck, lock); | | | |
| | | 21 | IdentifierGenerator generator = model.getIdentifier().createIdentifierGenerator(settings.getDialect(), settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), (RootClass)model); |
| | | 22 | identifierGenerators.put(model.getEntityName(), generator); |
Precondition Violations (0)
Row |
Violation |