if ( returnTypes.length == 1 ) { cacheable.add( returnTypes[0].disassemble( result.get( i ), session, null ) ); } else { cacheable.add( TypeFactory.disassemble( ( Object[] ) result.get( i ), returnTypes, null, session, null ) ); }
if ( returnTypes.length == 1 ) { result.add( returnTypes[0].assemble( ( Serializable ) cacheable.get( i ), session, null ) ); } else { result.add( TypeFactory.assemble( ( Serializable[] ) cacheable.get( i ), returnTypes, session, null ) ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/StandardQueryCache.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/StandardQueryCache.java
Method name: boolean put(QueryKey, Type[], List, boolean, SessionImplementor) Method name: List get(QueryKey, Type[], boolean, Set, SessionImplementor)
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( returnTypes.length == 1 ) {
1
if ( returnTypes.length == 1 ) {
2
					cacheable.add( returnTypes[0].disassemble( result.get( i ), session, null ) );
2
					result.add( returnTypes[0].assemble( ( Serializable ) cacheable.get( i ), session, null ) );
3
				}
3
				}
4
				else {
4
				else {
5
					cacheable.add(
5
					result.add(
6
							TypeFactory.disassemble(
6
							TypeFactory.assemble(
7
									( Object[] ) result.get( i ), returnTypes, null, session, null
7
									( Serializable[] ) cacheable.get( i ), returnTypes, session, null
8
							)
8
							)
9
					);
9
					);
10
				}
10
				}
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 declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    if (returnTypes.length == 1)
    19
    if (returnTypes.length == 1)
    10
    cacheable.add(returnTypes[0].disassemble(result.get(i), session, null));
    10
    cacheable.add(returnTypes[0].disassemble(result.get(i), session, null));
    Preondition Violations
    Unmatched statement cacheable.add(returnTypes[0].disassemble(result.get(i),session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                        
    else
            
    11
    cacheable.add(TypeFactory.disassemble((Object[])result.get(i), returnTypes, null, session, null));
    11
    cacheable.add(TypeFactory.disassemble((Object[])result.get(i), returnTypes, null, session, null));
    Preondition Violations
    Unmatched statement cacheable.add(TypeFactory.disassemble((Object[])result.get(i),returnTypes,null,session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                        
                                                                                                                                                                                                    
    21
    result.add(TypeFactory.assemble((Serializable[])cacheable.get(i), returnTypes, session, null));
    Preondition Violations
    Unmatched statement result.add(TypeFactory.assemble((Serializable[])cacheable.get(i),returnTypes,session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    21
    result.add(TypeFactory.assemble((Serializable[])cacheable.get(i), returnTypes, session, null));
                                                                                                                                                                              
    20
    result.add(returnTypes[0].assemble((Serializable)cacheable.get(i), session, null));
    Preondition Violations
    Unmatched statement result.add(returnTypes[0].assemble((Serializable)cacheable.get(i),session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    20
    result.add(returnTypes[0].assemble((Serializable)cacheable.get(i), session, null));
    Precondition Violations (4)
    Row Violation
    1Unmatched statement cacheable.add(returnTypes[0].disassemble(result.get(i),session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement cacheable.add(TypeFactory.disassemble((Object[])result.get(i),returnTypes,null,session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement result.add(TypeFactory.assemble((Serializable[])cacheable.get(i),returnTypes,session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement result.add(returnTypes[0].assemble((Serializable)cacheable.get(i),session,null)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted