if ( name.equals( NONE.name ) ) { return NONE; } else if ( name.equals( COUNT.name ) ) { return COUNT; } else if ( name.equals( PARAM.name ) ) { return PARAM; } else { return null; }
if ( name.equals( NONE.name ) ) { return NONE; } else if ( name.equals( FULL.name ) ) { return FULL; } else if ( name.equals( PARTIAL.name ) ) { return PARTIAL; } else { throw new StreamCorruptedException( "unrecognized value inclusion [" + name + "]" ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/ExecuteUpdateResultCheckStyle.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/ValueInclusion.java
Method name: ExecuteUpdateResultCheckStyle parse(String) Method name: Object readResolve()
Number of AST nodes: 7 Number of AST nodes: 7
1
if ( name.equals( NONE.name ) ) {
1
if ( name.equals( NONE.name ) ) {
2
			return NONE;
2
			return NONE;
3
		}
3
		}
4
		else if ( name.equals( COUNT.name ) ) {
4
		else if ( name.equals( FULL.name ) ) {
5
			return COUNT;
5
			return FULL;
6
		}
6
		}
7
		else if ( name.equals( PARAM.name ) ) {
7
		else if ( name.equals( PARTIAL.name ) ) {
8
			return PARAM;
8
			return PARTIAL;
9
		}
9
		}
10
		else {
10
		else {
11
			return null;
11
			throw new StreamCorruptedException( "unrecognized value inclusion [" + name + "]" );
12
		}
12
		}
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)1.0
Clones locationClones are in different classes
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (name.equals(NONE.name))
    1
    if (name.equals(NONE.name))
    1
    if (name.equals(NONE.name))
    Differences
    Expression1Expression2Difference
    org.hibernate.engine.ExecuteUpdateResultCheckStyleorg.hibernate.engine.ValueInclusionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.engine.ExecuteUpdateResultCheckStyle of variable NONE does not match with type org.hibernate.engine.ValueInclusion of variable NONE
    • Make classes org.hibernate.engine.ExecuteUpdateResultCheckStyle and org.hibernate.engine.ValueInclusion extend a common superclass
    1
    if (name.equals(NONE.name))
                                  
    2
    return NONE;
    Preondition Violations
    Unmatched return NONE;
    2
    return NONE;
    2
    return NONE;
    2
    return NONE;
    Preondition Violations
    Unmatched return NONE;
                                  
    3
    else if (name.equals(COUNT.name))
    3
    else if (name.equals(COUNT.name))
    3
    else if (name.equals(FULL.name))
    Differences
    Expression1Expression2Difference
    COUNTFULLVARIABLE_NAME_MISMATCH
    org.hibernate.engine.ExecuteUpdateResultCheckStyleorg.hibernate.engine.ValueInclusionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.engine.ExecuteUpdateResultCheckStyle of variable COUNT does not match with type org.hibernate.engine.ValueInclusion of variable FULL
    • Make classes org.hibernate.engine.ExecuteUpdateResultCheckStyle and org.hibernate.engine.ValueInclusion extend a common superclass
    3
    else if (name.equals(FULL.name))
                                  
    4
    return FULL;
    Preondition Violations
    Unmatched return FULL;
    4
    return FULL;
    4
    return COUNT;
    4
    return COUNT;
    Preondition Violations
    Unmatched return COUNT;
                                    
    5
    else if (name.equals(PARAM.name))
    5
    else if (name.equals(PARAM.name))
    5
    else if (name.equals(PARTIAL.name))
    Differences
    Expression1Expression2Difference
    PARAMPARTIALVARIABLE_NAME_MISMATCH
    org.hibernate.engine.ExecuteUpdateResultCheckStyleorg.hibernate.engine.ValueInclusionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.engine.ExecuteUpdateResultCheckStyle of variable PARAM does not match with type org.hibernate.engine.ValueInclusion of variable PARTIAL
    • Make classes org.hibernate.engine.ExecuteUpdateResultCheckStyle and org.hibernate.engine.ValueInclusion extend a common superclass
    5
    else if (name.equals(PARTIAL.name))
                                        
    6
    return PARTIAL;
    Preondition Violations
    Unmatched return PARTIAL;
    6
    return PARTIAL;
    6
    return PARAM;
    6
    return PARAM;
    Preondition Violations
    Unmatched return PARAM;
                                    
    else
            
                                                                                                                                                                              
    7
    throw new StreamCorruptedException("unrecognized value inclusion [" + name + "]");
    Preondition Violations
    Unmatched throw new StreamCorruptedException("unrecognized value inclusion [" + name + "]");
    7
    throw new StreamCorruptedException("unrecognized value inclusion [" + name + "]");
    7
    return null;
    7
    return null;
    Preondition Violations
    Unmatched return null;
                                  
    Precondition Violations (11)
    Row Violation
    1Type org.hibernate.engine.ExecuteUpdateResultCheckStyle of variable NONE does not match with type org.hibernate.engine.ValueInclusion of variable NONE
    2Unmatched return NONE;
    3Unmatched return NONE;
    4Type org.hibernate.engine.ExecuteUpdateResultCheckStyle of variable COUNT does not match with type org.hibernate.engine.ValueInclusion of variable FULL
    5Unmatched return FULL;
    6Unmatched return COUNT;
    7Type org.hibernate.engine.ExecuteUpdateResultCheckStyle of variable PARAM does not match with type org.hibernate.engine.ValueInclusion of variable PARTIAL
    8Unmatched return PARTIAL;
    9Unmatched return PARAM;
    10Unmatched throw new StreamCorruptedException("unrecognized value inclusion [" + name + "]");
    11Unmatched return null;