for ( int i=0; i<tuple.length; i++ ) { String alias = aliases[i]; if ( alias!=null ) { result.put( alias, tuple[i] ); } }
for ( int i = 0; i < tuple.length; i++ ) { String alias = aliases[i]; if ( alias != null ) { result.put( alias.toUpperCase(), tuple[i] ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transform/AliasToEntityMapResultTransformer.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java
Method name: Object transformTuple(Object[], String[]) Method name: Object transformTuple(Object[], String[])
Number of AST nodes: 4 Number of AST nodes: 4
1
for ( int i=0; i<tuple.length; i++ ) {
1
for ( int i = 0; i < tuple.length; i++ ) {
2
			String alias = aliases[i];
2
				String alias = aliases[i];
3
			if ( alias!=null ) {
3
				if ( alias != null ) {
4
				result.put( alias, tuple[i] );
4
					result.put( alias.toUpperCase(), tuple[i] );
5
			}
5
				}
6
		}
6
			}
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 having the same super class
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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (int i = 0; i < tuple.length; i++)
    2
    for (int i = 0; i < tuple.length; i++)
    3
    String alias = aliases[i];
    3
    String alias = aliases[i];
    4
    if (alias != null)
    4
    if (alias != null)
    5
    result.put(alias, tuple[i]);
    5
    result.put(alias, tuple[i]);
    5
    result.put(alias.toUpperCase(), tuple[i]);
    Differences
    Expression1Expression2Difference
    aliasalias.toUpperCase()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression alias cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression alias.toUpperCase() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    result.put(alias.toUpperCase(), tuple[i]);
    Precondition Violations (2)
    Row Violation
    1Expression alias cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression alias.toUpperCase() cannot be parameterized, because it has dependencies to/from statements that will be extracted