String[] result = new String[templates.length]; for ( int i =0; i<templates.length; i++ ) { result[i] = replace( templates[i], placeholder, replacement ); } return result;
String[] aliases = new String[ sqlIdentifiers.length ]; for ( int i=0; i<sqlIdentifiers.length; i++ ) { aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]); } return aliases;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/StringHelper.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Alias.java
Method name: String[] replace(String[], String, String) Method name: String[] toUnquotedAliasStrings(String[])
Number of AST nodes: 4 Number of AST nodes: 4
1
String[] result = new String[templates.length];
1
String[] aliases = new String[ sqlIdentifiers.length ];
2
		for ( int i =0; i<templates.length; i++ ) {
2
		for ( int i=0; i<sqlIdentifiers.length; i++ ) {
3
			result[i] = replace( templates[i], placeholder, replacement );
3
			aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);
4
		}
4
		}
5
		return result;
5
		return aliases;
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 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)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String[] result = new String[templates.length];
    1
    String[] result = new String[templates.length];
    1
    String[] aliases = new String[sqlIdentifiers.length];
    Differences
    Expression1Expression2Difference
    resultaliasesVARIABLE_NAME_MISMATCH
    templatessqlIdentifiersVARIABLE_NAME_MISMATCH
    1
    String[] aliases = new String[sqlIdentifiers.length];
    2
    for (int i = 0; i < templates.length; i++)
    2
    for (int i = 0; i < templates.length; i++)
    2
    for (int i = 0; i < sqlIdentifiers.length; i++)
    Differences
    Expression1Expression2Difference
    templatessqlIdentifiersVARIABLE_NAME_MISMATCH
    2
    for (int i = 0; i < sqlIdentifiers.length; i++)
    3
    result[i] = replace(templates[i], placeholder, replacement);
    3
    result[i] = replace(templates[i], placeholder, replacement);
    3
    aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);
    Differences
    Expression1Expression2Difference
    resultaliasesVARIABLE_NAME_MISMATCH
    replacetoUnquotedAliasStringMETHOD_INVOCATION_NAME_MISMATCH
    replace(templates[i],placeholder,replacement)toUnquotedAliasString(sqlIdentifiers[i])ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression replace(templates[i],placeholder,replacement) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression toUnquotedAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression replace(templates[i],placeholder,replacement) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression toUnquotedAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);
    4
    return result;
    4
    return result;
    4
    return aliases;
    Differences
    Expression1Expression2Difference
    resultaliasesVARIABLE_NAME_MISMATCH
    4
    return aliases;
    Precondition Violations (4)
    Row Violation
    1Expression replace(templates[i],placeholder,replacement) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression toUnquotedAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression replace(templates[i],placeholder,replacement) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression toUnquotedAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted