NativeSQLQueryNonScalarReturn rtn = ( NativeSQLQueryNonScalarReturn ) queryReturns[i]; alias2Return.put( rtn.getAlias(), rtn ); if ( rtn instanceof NativeSQLQueryJoinReturn ) { NativeSQLQueryJoinReturn fetchReturn = ( NativeSQLQueryJoinReturn ) rtn; alias2OwnerAlias.put( fetchReturn.getAlias(), fetchReturn.getOwnerAlias() ); }
Property prop = (Property) iter.next(); boolean[] chunk = prop.getValue().getColumnInsertability(); if ( prop.isInsertable() ) { System.arraycopy(chunk, 0, result, i, chunk.length); } i+=chunk.length;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryReturnProcessor.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/Component.java
Method name: ResultAliasContext process() Method name: boolean[] getColumnInsertability()
Number of AST nodes: 5 Number of AST nodes: 5
1
NativeSQLQueryNonScalarReturn rtn = ( NativeSQLQueryNonScalarReturn ) queryReturns[i];
2
				alias2Return.put( rtn.getAlias(), rtn );
3
				if ( rtn instanceof NativeSQLQueryJoinReturn
1
Property prop = (Property) iter.next();
2
			boolean[] chunk = prop.getValue().getColumnInsertability();
4
 ) {
3
			if ( prop.isInsertable() ) {
5
					NativeSQLQueryJoinReturn fetchReturn = ( NativeSQLQueryJoinReturn ) rtn;
4
				
6
					alias2OwnerAlias.put( fetchReturn.getAlias(), fetchReturn.getOwnerAlias() );
7
				}
5
System.arraycopy(chunk, 0, result, i, chunk.length);
6
			}
7
			i+=chunk.length;
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.1
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)11.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    NativeSQLQueryNonScalarReturn rtn = (NativeSQLQueryNonScalarReturn)queryReturns[i];
    3
    NativeSQLQueryNonScalarReturn rtn = (NativeSQLQueryNonScalarReturn)queryReturns[i];
    Preondition Violations
    Unmatched statement NativeSQLQueryNonScalarReturn rtn=(NativeSQLQueryNonScalarReturn)queryReturns[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                            
    4
    alias2Return.put(rtn.getAlias(), rtn);
                                                                                    
                                                                                  
    5
    Property prop = (Property)iter.next();
    Preondition Violations
    Unmatched statement Property prop=(Property)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    Property prop = (Property)iter.next();
                                                                                                                            
    6
    boolean[] chunk = prop.getValue().getColumnInsertability();
    5
    if (rtn instanceof NativeSQLQueryJoinReturn)
    5
    if (rtn instanceof NativeSQLQueryJoinReturn)
    7
    if (prop.isInsertable())
    Differences
    Expression1Expression2Difference
    rtn instanceof NativeSQLQueryJoinReturnprop.isInsertable()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression rtn instanceof NativeSQLQueryJoinReturn cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression prop.isInsertable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    if (prop.isInsertable())
    6
    NativeSQLQueryJoinReturn fetchReturn = (NativeSQLQueryJoinReturn)rtn;
    6
    NativeSQLQueryJoinReturn fetchReturn = (NativeSQLQueryJoinReturn)rtn;
    Preondition Violations
    Unmatched statement NativeSQLQueryJoinReturn fetchReturn=(NativeSQLQueryJoinReturn)rtn; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                
    7
    alias2OwnerAlias.put(fetchReturn.getAlias(), fetchReturn.getOwnerAlias());
                                                                                                                                                            
                                                                                                          
    8
    System.arraycopy(chunk, 0, result, i, chunk.length);
                                          
    9
    i += chunk.length;
    Precondition Violations (6)
    Row Violation
    1Unmatched statement NativeSQLQueryNonScalarReturn rtn=(NativeSQLQueryNonScalarReturn)queryReturns[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Property prop=(Property)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression rtn instanceof NativeSQLQueryJoinReturn cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression prop.isInsertable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement NativeSQLQueryJoinReturn fetchReturn=(NativeSQLQueryJoinReturn)rtn; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero