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 statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    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() + "]");
    36
    log.trace("Building cache for entity data [" + model.getEntityName() + "]");
    54
    log.trace("Building cache for collection data [" + model.getRole() + "]");
    Differences
    Expression1Expression2Difference
    "Building cache for entity data [""Building cache for collection data ["LITERAL_VALUE_MISMATCH
    getEntityNamegetRoleMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.mapping.PersistentClassorg.hibernate.mapping.CollectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.mapping.PersistentClass of variable model does not match with type org.hibernate.mapping.Collection of variable model
    • Make classes org.hibernate.mapping.PersistentClass and org.hibernate.mapping.Collection extend a common superclass
    54
    log.trace("Building cache for collection data [" + model.getRole() + "]");
    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);
                                                                                                                                    
                                                                                                                                                                                                                                                                                                                          
    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.CollectionRegionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression entityRegion cannot be unified with expression collectionRegion , because common superclass type org.hibernate.cache.TransactionalDataRegion cannot be passed as an argument to public abstract java.lang.Object put(java.lang.Object, java.lang.Object)
    58
    allCacheRegions.put(cacheRegionName, collectionRegion);
    Precondition Violations (5)
    Row Violation
    1Type org.hibernate.mapping.PersistentClass of variable model does not match with type org.hibernate.mapping.Collection of variable model
    2Unmatched 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
    3Unmatched 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
    4Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable accessStrategy does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable accessStrategy
    5Expression entityRegion cannot be unified with expression collectionRegion , because common superclass type org.hibernate.cache.TransactionalDataRegion cannot be passed as an argument to public abstract java.lang.Object put(java.lang.Object, java.lang.Object)