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++ ) { s.append( persister.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 infoString(EntityPersister, 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
				s.append( persister.getIdentifierType().toLoggableString( ids[i], factory ) );
3
			if ( i < args.size() - 1 ) {
3
				if ( i < ids.length-1 ) {
4
				buf.append( sep );
4
					s.append( ", " );
5
			}
5
				}
6
		}
6
			}
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.3
Clones locationClones are in different classes
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.3
    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)));
    Preondition Violations
    Unmatched statement buf.append(transformArgument((String)args.get(i))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                
                                                                                                                                                            
    8
    s.append(persister.getIdentifierType().toLoggableString(ids[i], factory));
    Preondition Violations
    Unmatched statement s.append(persister.getIdentifierType().toLoggableString(ids[i],factory)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement s.append(persister.getIdentifierType().toLoggableString(ids[i],factory)); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    8
    s.append(persister.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 (3)
    Row Violation
    1Unmatched statement buf.append(transformArgument((String)args.get(i))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement s.append(persister.getIdentifierType().toLoggableString(ids[i],factory)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement s.append(persister.getIdentifierType().toLoggableString(ids[i],factory)); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted