String entityName = ( ( AssociationType ) indexType ).getAssociatedEntityName( this ); Set roles = ( Set ) tmpEntityToCollectionRoleMap.get( entityName ); if ( roles == null ) { roles = new HashSet(); tmpEntityToCollectionRoleMap.put( entityName, roles ); } roles.add( persister.getRole() );
String entityName = ( ( AssociationType ) elementType ).getAssociatedEntityName( this ); Set roles = ( Set ) tmpEntityToCollectionRoleMap.get( entityName ); if ( roles == null ) { roles = new HashSet(); tmpEntityToCollectionRoleMap.put( entityName, roles ); } roles.add( persister.getRole() );
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: 6 Number of AST nodes: 6
1
String entityName = ( ( AssociationType ) indexType ).getAssociatedEntityName( this );
1
String entityName = ( ( AssociationType ) elementType ).getAssociatedEntityName( this );
2
				Set roles = ( Set ) tmpEntityToCollectionRoleMap.get( entityName );
2
				Set roles = ( Set ) tmpEntityToCollectionRoleMap.get( entityName );
3
				if ( roles == null ) {
3
				if ( roles == null ) {
4
					roles = new HashSet();
4
					roles = new HashSet();
5
					tmpEntityToCollectionRoleMap.put( entityName, roles );
5
					tmpEntityToCollectionRoleMap.put( entityName, roles );
6
				}
6
				}
7
				roles.add( persister.getRole() );
7
				roles.add( persister.getRole() );
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in the same method
Number of node comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    63
    String entityName = ((AssociationType)indexType).getAssociatedEntityName(this);
    63
    String entityName = ((AssociationType)indexType).getAssociatedEntityName(this);
    71
    String entityName = ((AssociationType)elementType).getAssociatedEntityName(this);
    Differences
    Expression1Expression2Difference
    indexTypeelementTypeVARIABLE_NAME_MISMATCH
    71
    String entityName = ((AssociationType)elementType).getAssociatedEntityName(this);
    64
    Set roles = (Set)tmpEntityToCollectionRoleMap.get(entityName);
    72
    Set roles = (Set)tmpEntityToCollectionRoleMap.get(entityName);
    65
    if (roles == null)
    73
    if (roles == null)
    66
    roles = new HashSet();
    74
    roles = new HashSet();
    67
    tmpEntityToCollectionRoleMap.put(entityName, roles);
    75
    tmpEntityToCollectionRoleMap.put(entityName, roles);
    68
    roles.add(persister.getRole());
    76
    roles.add(persister.getRole());
    Precondition Violations (0)
    Row Violation