StringBuffer s = new StringBuffer(); s.append( '[' ); if( persister == null ) { s.append( "<null EntityPersister>" ); } else { s.append( persister.getEntityName() ); } s.append( '#' ); if ( id == null ) { s.append( "<null>" ); } else { s.append( identifierType.toLoggableString( id, factory ) ); } s.append( ']' ); return s.toString();
StringBuffer s = new StringBuffer(); s.append( '[' ); if ( persister == null ) { s.append( "<unreferenced>" ); } else { s.append( persister.getRole() ); s.append( '#' ); if ( id == null ) { s.append( "<null>" ); } else { // Need to use the identifier type of the collection owner // since the incoming is value is actually the owner's id. // Using the collection's key type causes problems with // property-ref keys... s.append( persister.getOwnerEntityPersister().getIdentifierType().toLoggableString( id, factory ) ); } } s.append( ']' ); return s.toString();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/pretty/MessageHelper.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/pretty/MessageHelper.java
Method name: String infoString(EntityPersister, Object, Type, SessionFactoryImplementor) Method name: String collectionInfoString(CollectionPersister, Serializable, SessionFactoryImplementor)
Number of AST nodes: 11 Number of AST nodes: 11
1
StringBuffer s = new StringBuffer();
1
StringBuffer s = new StringBuffer();
2
		s.append( '[' );
2
		s.append( '[' );
3
		if( persister == null ) {
3
		if ( persister == null ) {
4
			s.append( "<null EntityPersister>" );
4
			s.append( "<unreferenced>" );
5
		}
5
		}
6
		else {
6
		else {
7
			s.append( persister.getEntityName() );
7
			s.append( persister.getRole() );
8
		}
8
		
9
		s.append( '#' );
9
	s.append( '#' );
10
		if ( id == null ) {
10
			if ( id == null ) {
11
			s.append( "<null>" );
11
				s.append( "<null>" );
12
		}
12
			}
13
		else {
13
			else {
14
			s.append( i
14
				// Need to use the identifier type of the collection owner
15
				// since the incoming is value is actually the owner's id.
16
				// Using the collection's key type causes problems with
17
				// property-ref keys...
15
dentifierType.toLoggableString( id, factory ) );
18
				s.append( persister.getOwnerEntityPersister().getIdentifierType().toLoggableString( id, factory ) );
16
		
19
			}
17
}
20
		}
18
		s.append( ']' );
21
		s.append( ']' );
19
		return s.toString();
22
		return s.toString();
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.2
Clones locationClones are declared in the same class
Number of node comparisons14
  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)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StringBuffer s = new StringBuffer();
                                                                              
                                                                      
    5
    s.append(persister.getRole());
    2
    s.append('[');
    2
    s.append('[');
    6
    s.append('#');
    Differences
    Expression1Expression2Difference
    '[''#'LITERAL_VALUE_MISMATCH
    6
    s.append('#');
    3
    if (persister == null)
    3
    if (persister == null)
    7
    if (id == null)
    Differences
    Expression1Expression2Difference
    persisteridVARIABLE_NAME_MISMATCH
    org.hibernate.persister.entity.EntityPersisterjava.io.SerializableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type java.io.Serializable of variable id
    • Make classes org.hibernate.persister.entity.EntityPersister and java.io.Serializable extend a common superclass
    7
    if (id == null)
    4
    s.append("<null EntityPersister>");
    4
    s.append("<null EntityPersister>");
    8
    s.append("<null>");
    Differences
    Expression1Expression2Difference
    """"LITERAL_VALUE_MISMATCH
    8
    s.append("<null>");
    else
            
    5
    s.append(persister.getEntityName());
                                                                                  
                                                                                                                                                                                                        
    9
    s.append(persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(id, factory));
    Precondition Violations (1)
    Row Violation
    1Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type java.io.Serializable of variable id