final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); return result;
final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result;
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/ArtifactStatus.java File path: /sql12/test/mockobjects/net/sourceforge/squirrel_sql/fw/sql/MockSQLDriver.java
Method name: int hashCode() Method name: int hashCode()
Number of AST nodes: 5 Number of AST nodes: 4
1
final int prime = 31;
1
final int prime = 31;
2
      int result = 1;
2
		int result = 1;
3
      result = prime * result + ((name == null) ? 0 : name.hashCode());
3
		result = prime * result + ((
4
      result = prime * result + ((type == null) ? 0 : type.hashCode());
4
id == null) ? 0 : id.hashCode());
5
      return result;
5
		return result;
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.0
Clones locationClones are in different classes
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    final int prime = 31;
    1
    final int prime = 31;
    2
    int result = 1;
    2
    int result = 1;
    3
    result = prime * result + ((name == null) ? 0 : name.hashCode());
    3
    result = prime * result + ((name == null) ? 0 : name.hashCode());
    Preondition Violations
    Unmatched statement result=prime * result + ((name == null) ? 0 : name.hashCode()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                        
    4
    result = prime * result + ((type == null) ? 0 : type.hashCode());
    4
    result = prime * result + ((type == null) ? 0 : type.hashCode());
    3
    result = prime * result + ((id == null) ? 0 : id.hashCode());
    Differences
    Expression1Expression2Difference
    typeidVARIABLE_NAME_MISMATCH
    java.lang.Stringnet.sourceforge.squirrel_sql.fw.id.IIdentifierVARIABLE_TYPE_MISMATCH
    typeidVARIABLE_NAME_MISMATCH
    java.lang.Stringnet.sourceforge.squirrel_sql.fw.id.IIdentifierVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.fw.id.IIdentifier of variable id
    • Make classes java.lang.String and net.sourceforge.squirrel_sql.fw.id.IIdentifier extend a common superclass
    Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.fw.id.IIdentifier of variable id
    • Make classes java.lang.String and net.sourceforge.squirrel_sql.fw.id.IIdentifier extend a common superclass
    3
    result = prime * result + ((id == null) ? 0 : id.hashCode());
    5
    return result;
    4
    return result;
    Precondition Violations (4)
    Row Violation
    1Unmatched statement result=prime * result + ((name == null) ? 0 : name.hashCode()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.fw.id.IIdentifier of variable id
    3Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.fw.id.IIdentifier of variable id
    4Clone fragment #1 returns variables prime, result , while Clone fragment #2 returns variables