String rawAliases[] = (String[]) collectionPropertyColumnAliases.get(propertyName); if ( rawAliases == null ) { return null; } String result[] = new String[rawAliases.length]; for ( int i=0; i<rawAliases.length; i++ ) { result[i] = new Alias(suffix).toUnquotedAliasString( rawAliases[i] ); } return result;
String rawAliases[] = ( String[] ) subclassPropertyAliases.get( propertyName ); if ( rawAliases == null ) { return null; } String result[] = new String[rawAliases.length]; for ( int i = 0; i < rawAliases.length; i++ ) { result[i] = new Alias( suffix ).toUnquotedAliasString( rawAliases[i] ); } return result;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
Method name: String[] getCollectionPropertyColumnAliases(String, String) Method name: String[] getSubclassPropertyColumnAliases(String, String)
Number of AST nodes: 7 Number of AST nodes: 7
1
String rawAliases[] = (String[]) collectionPropertyColumnAliases.get(propertyName);
1
String rawAliases[] = ( String[] ) subclassPropertyAliases.get( propertyName );
2
		if ( rawAliases == null ) {
2
		if ( rawAliases == null ) {
3
			return null;
3
			return null;
4
		}
4
		}
5
		
6
		String result[] = new String[rawAliases.length];
5
		String result[] = new String[rawAliases.length];
7
		for ( int i=0; i<rawAliases.length; i++ ) {
6
		for ( int i = 0; i < rawAliases.length; i++ ) {
8
			result[i] = new Alias(suffix).toUnquotedAliasString( rawAliases[i] );
7
			result[i] = new Alias( suffix ).toUnquotedAliasString( rawAliases[i] );
9
		}
8
		}
10
		return result;
9
		return result;
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.7
Clones locationClones are in different classes
Number of node comparisons19
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String rawAliases [] = (String[])collectionPropertyColumnAliases.get(propertyName);
    1
    String rawAliases [] = (String[])collectionPropertyColumnAliases.get(propertyName);
    1
    String rawAliases [] = (String[])subclassPropertyAliases.get(propertyName);
    Differences
    Expression1Expression2Difference
    collectionPropertyColumnAliasessubclassPropertyAliasesVARIABLE_NAME_MISMATCH
    1
    String rawAliases [] = (String[])subclassPropertyAliases.get(propertyName);
    2
    if (rawAliases == null)
    2
    if (rawAliases == null)
    3
    return null;
    3
    return null;
    4
    String result [] = new String[rawAliases.length];
    4
    String result [] = new String[rawAliases.length];
    5
    for (int i = 0; i < rawAliases.length; i++)
    5
    for (int i = 0; i < rawAliases.length; i++)
    6
    result[i] = new Alias(suffix).toUnquotedAliasString(rawAliases[i]);
    6
    result[i] = new Alias(suffix).toUnquotedAliasString(rawAliases[i]);
    7
    return result;
    7
    return result;
    Precondition Violations (0)
    Row Violation