log.trace( "Building cache for entity data [" + model.getEntityName() + "]" ); EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) ); accessStrategy = entityRegion.buildAccessStrategy( accessType ); entityAccessStrategies.put( cacheRegionName, accessStrategy ); allCacheRegions.put( cacheRegionName, entityRegion );
log.trace( "Building cache for collection data [" + model.getRole() + "]" ); CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) ); accessStrategy = collectionRegion.buildAccessStrategy( accessType ); entityAccessStrategies.put( cacheRegionName, accessStrategy ); allCacheRegions.put( cacheRegionName, collectionRegion );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
Method name: void SessionFactoryImpl(Configuration, Mapping, Settings, EventListeners, SessionFactoryObserver) Method name: void SessionFactoryImpl(Configuration, Mapping, Settings, EventListeners, SessionFactoryObserver)
Number of AST nodes: 5 Number of AST nodes: 5
1
log.trace( "Building cache for entity data [" + model.getEntityName() + "]" );
1
log.trace( "Building cache for collection data [" + model.getRole() + "]" );
2
					EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
2
				CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
3
					accessStrategy = entityRegion.buildAccessStrategy( accessType );
3
				accessStrategy = collectionRegion.buildAccessStrategy( accessType );
4
					entityAccessStrategies.put( cacheRegionName, accessStrategy );
4
				entityAccessStrategies.put( cacheRegionName, accessStrategy );
5
					allCacheRegions.put( cacheRegionName, entityRegion );
5
				allCacheRegions.put( cacheRegionName, collectionRegion );
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.0
Clones locationClones are in the same method
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    36
    log.trace("Building cache for entity data [" + model.getEntityName() + "]");
                                                                                                                                                                    
    37
    EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion(cacheRegionName, properties, CacheDataDescriptionImpl.decode(model));
    37
    EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion(cacheRegionName, properties, CacheDataDescriptionImpl.decode(model));
    Preondition Violations
    Unmatched statement EntityRegion entityRegion=settings.getRegionFactory().buildEntityRegion(cacheRegionName,properties,CacheDataDescriptionImpl.decode(model)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                                                                  
    38
    accessStrategy = entityRegion.buildAccessStrategy(accessType);
                                                                                                                                    
                                                                                                                                                                
    54
    log.trace("Building cache for collection data [" + model.getRole() + "]");
                                                                                                                                                                                                                                                                                                                          
    55
    CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion(cacheRegionName, properties, CacheDataDescriptionImpl.decode(model));
    Preondition Violations
    Unmatched statement CollectionRegion collectionRegion=settings.getRegionFactory().buildCollectionRegion(cacheRegionName,properties,CacheDataDescriptionImpl.decode(model)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    55
    CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion(cacheRegionName, properties, CacheDataDescriptionImpl.decode(model));
                                                                                                                                            
    56
    accessStrategy = collectionRegion.buildAccessStrategy(accessType);
    39
    entityAccessStrategies.put(cacheRegionName, accessStrategy);
    39
    entityAccessStrategies.put(cacheRegionName, accessStrategy);
    57
    entityAccessStrategies.put(cacheRegionName, accessStrategy);
    Differences
    Expression1Expression2Difference
    org.hibernate.cache.access.EntityRegionAccessStrategyorg.hibernate.cache.access.CollectionRegionAccessStrategyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable accessStrategy does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable accessStrategy
    • Make classes org.hibernate.cache.access.EntityRegionAccessStrategy and org.hibernate.cache.access.CollectionRegionAccessStrategy extend a common superclass
    57
    entityAccessStrategies.put(cacheRegionName, accessStrategy);
    40
    allCacheRegions.put(cacheRegionName, entityRegion);
    40
    allCacheRegions.put(cacheRegionName, entityRegion);
    58
    allCacheRegions.put(cacheRegionName, collectionRegion);
    Differences
    Expression1Expression2Difference
    entityRegioncollectionRegionVARIABLE_NAME_MISMATCH
    org.hibernate.cache.EntityRegionorg.hibernate.cache.CollectionRegionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.EntityRegion of variable entityRegion does not match with type org.hibernate.cache.CollectionRegion of variable collectionRegion
    • Make classes org.hibernate.cache.EntityRegion and org.hibernate.cache.CollectionRegion extend a common superclass
    58
    allCacheRegions.put(cacheRegionName, collectionRegion);
    Precondition Violations (4)
    Row Violation
    1Unmatched statement EntityRegion entityRegion=settings.getRegionFactory().buildEntityRegion(cacheRegionName,properties,CacheDataDescriptionImpl.decode(model)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement CollectionRegion collectionRegion=settings.getRegionFactory().buildCollectionRegion(cacheRegionName,properties,CacheDataDescriptionImpl.decode(model)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable accessStrategy does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable accessStrategy
    4Type org.hibernate.cache.EntityRegion of variable entityRegion does not match with type org.hibernate.cache.CollectionRegion of variable collectionRegion