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() );
|
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 8.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
63 | String entityName = ((AssociationType)indexType).getAssociatedEntityName(this); | | 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 | | | 74 | |
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 |