if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } FormatStyle that = ( FormatStyle ) o; return name.equals( that.name );
if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final NativeSQLQuerySpecification that = ( NativeSQLQuerySpecification ) o; return querySpaces.equals( that.querySpaces ) && queryString.equals( that.queryString ) && Arrays.equals( queryReturns, that.queryReturns );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/util/FormatStyle.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQuerySpecification.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 6 Number of AST nodes: 6
1
if ( this == o ) {
1
if ( this == o ) {
2
			return true;
2
			return true;
3
		}
3
		}
4
		if ( o == null || getClass() != o.getClass() ) {
4
		if ( o == null || getClass() != o.getClass() ) {
5
			return false;
5
			return false;
6
		}
6
		}
7
		FormatStyle that = ( FormatStyle
8
 ) o;
7
		final NativeSQLQuerySpecification that = ( NativeSQLQuerySpecification ) o;
8

9
		return name.equals( that.name
9
		return querySpaces.equals( that.querySpaces ) &&
10
		       queryString.equals( that.queryString ) &&
10
 );
11
		       Arrays.equals( queryReturns, that.queryReturns );
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.5
Clones locationClones are in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this == o)
    1
    if (this == o)
    2
    return true;
    2
    return true;
    3
    if (o == null || getClass() != o.getClass())
    3
    if (o == null || getClass() != o.getClass())
    3
    if (o == null || getClass() != o.getClass())
    Differences
    Expression1Expression2Difference
    java.lang.Classjava.lang.ClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()
    • Make classes java.lang.Class and java.lang.Class extend a common superclass
    3
    if (o == null || getClass() != o.getClass())
    4
    return false;
    4
    return false;
                                                                                                                                                      
    5
    final NativeSQLQuerySpecification that = (NativeSQLQuerySpecification)o;
    5
    FormatStyle that = (FormatStyle)o;
                                                                          
    6
    return name.equals(that.name);
    6
    return name.equals(that.name);
    6
    return querySpaces.equals(that.querySpaces) && queryString.equals(that.queryString) && Arrays.equals(queryReturns, that.queryReturns);
    Differences
    Expression1Expression2Difference
    name.equals(that.name)querySpaces.equals(that.querySpaces) && queryString.equals(that.queryString) && Arrays.equals(queryReturns,that.queryReturns)TYPE_COMPATIBLE_REPLACEMENT
    6
    return querySpaces.equals(that.querySpaces) && queryString.equals(that.queryString) && Arrays.equals(queryReturns, that.queryReturns);
    Precondition Violations (1)
    Row Violation
    1Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()