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
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)36.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (persister.hasCache())
    1
    if (persister.hasCache())
    20
    if (!model.isInherited())
    Differences
    Expression1Expression2Difference
    persister.hasCache()!model.isInherited()TYPE_COMPATIBLE_REPLACEMENT
    20
    if (!model.isInherited())
    2
    final CacheKey ck = new CacheKey(key, persister.getKeyType(), persister.getRole(), session.getEntityMode(), session.getFactory());
    2
    final CacheKey ck = new CacheKey(key, persister.getKeyType(), persister.getRole(), session.getEntityMode(), session.getFactory());
    Preondition Violations
    Unmatched statement final CacheKey ck=new CacheKey(key,persister.getKeyType(),persister.getRole(),session.getEntityMode(),session.getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                                                                                  
    3
    persister.getCacheAccessStrategy().unlockItem(ck, lock);
    3
    persister.getCacheAccessStrategy().unlockItem(ck, lock);
    Preondition Violations
    Unmatched statement persister.getCacheAccessStrategy().unlockItem(ck,lock); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement persister.getCacheAccessStrategy().unlockItem(ck,lock); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                        
                                                                                                                                                                                                                                                                                                                                                                                          
    21
    IdentifierGenerator generator = model.getIdentifier().createIdentifierGenerator(settings.getDialect(), settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), (RootClass)model);
    Preondition Violations
    Unmatched statement IdentifierGenerator generator=model.getIdentifier().createIdentifierGenerator(settings.getDialect(),settings.getDefaultCatalogName(),settings.getDefaultSchemaName(),(RootClass)model); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement IdentifierGenerator generator=model.getIdentifier().createIdentifierGenerator(settings.getDialect(),settings.getDefaultCatalogName(),settings.getDefaultSchemaName(),(RootClass)model); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    21
    IdentifierGenerator generator = model.getIdentifier().createIdentifierGenerator(settings.getDialect(), settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), (RootClass)model);
                                                                                                                                
    22
    identifierGenerators.put(model.getEntityName(), generator);
    Preondition Violations
    Unmatched statement identifierGenerators.put(model.getEntityName(),generator); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    22
    identifierGenerators.put(model.getEntityName(), generator);
    Precondition Violations (7)
    Row Violation
    1Unmatched statement final CacheKey ck=new CacheKey(key,persister.getKeyType(),persister.getRole(),session.getEntityMode(),session.getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement persister.getCacheAccessStrategy().unlockItem(ck,lock); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement persister.getCacheAccessStrategy().unlockItem(ck,lock); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    4Unmatched statement IdentifierGenerator generator=model.getIdentifier().createIdentifierGenerator(settings.getDialect(),settings.getDefaultCatalogName(),settings.getDefaultSchemaName(),(RootClass)model); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement IdentifierGenerator generator=model.getIdentifier().createIdentifierGenerator(settings.getDialect(),settings.getDefaultCatalogName(),settings.getDefaultSchemaName(),(RootClass)model); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6Unmatched statement identifierGenerators.put(model.getEntityName(),generator); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero