for ( int i = 0; i < args.size(); i++ ) { buf.append( transformArgument( ( String ) args.get( i ) ) ); if ( i < args.size() - 1 ) { buf.append( sep ); } }
for ( int i = 0; i < ids.length; i++ ) { // 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( ids[i], factory ) ); if ( i < ids.length-1 ) { s.append( ", " ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/dialect/function/VarArgsSQLFunction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/pretty/MessageHelper.java
Method name: String render(List, SessionFactoryImplementor) Method name: String collectionInfoString(CollectionPersister, Serializable[], SessionFactoryImplementor)
Number of AST nodes: 4 Number of AST nodes: 4
1
for ( int i = 0; i < args.size(); i++ ) {
1
for ( int i = 0; i < ids.length; i++ ) {
2
			buf.append( transformArgument( ( String ) args.get( i )
2
				// Need to use the identifier type of the collection owner
3
				// since the incoming is value is actually the owner's id.
4
				// Using the collection's key type causes problems with
5
				// property-ref keys...
3
 ) );
6
				s.append( persister.getOwnerEntityPersister().getIdentifierType().toLoggableString( ids[i], factory ) );
4
			if ( i < args.size() - 1 ) {
7
				if ( i < ids.length-1 ) {
5
				buf.append( sep );
8
					s.append( ", " );
6
			}
9
				}
7
		}
10
			}
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.3
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (int i = 0; i < args.size(); i++)
    2
    for (int i = 0; i < args.size(); i++)
    7
    for (int i = 0; i < ids.length; i++)
    Differences
    Expression1Expression2Difference
    args.size()ids.lengthTYPE_COMPATIBLE_REPLACEMENT
    7
    for (int i = 0; i < ids.length; i++)
    3
    buf.append(transformArgument((String)args.get(i)));
    3
    buf.append(transformArgument((String)args.get(i)));
    8
    s.append(persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i], factory));
    Differences
    Expression1Expression2Difference
    transformArgumenttoLoggableStringMETHOD_INVOCATION_NAME_MISMATCH
    transformArgument((String)args.get(i))persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i],factory)ARGUMENT_NUMBER_MISMATCH
    persister.getOwnerEntityPersister().getIdentifierType()MISSING_METHOD_INVOCATION_EXPRESSION
    bufsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transformArgument((String)args.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i],factory) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression transformArgument((String)args.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i],factory) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    s.append(persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i], factory));
    4
    if (i < args.size() - 1)
    4
    if (i < args.size() - 1)
    9
    if (i < ids.length - 1)
    Differences
    Expression1Expression2Difference
    args.size()ids.lengthTYPE_COMPATIBLE_REPLACEMENT
    9
    if (i < ids.length - 1)
    5
    buf.append(sep);
    5
    buf.append(sep);
    10
    s.append(", ");
    Differences
    Expression1Expression2Difference
    sep", "TYPE_COMPATIBLE_REPLACEMENT
    bufsVARIABLE_NAME_MISMATCH
    10
    s.append(", ");
    Precondition Violations (4)
    Row Violation
    1Expression transformArgument((String)args.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i],factory) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression transformArgument((String)args.get(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i],factory) cannot be parameterized, because it has dependencies to/from statements that will be extracted