if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ArtifactStatus other = (ArtifactStatus) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; return true;
if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ChannelXmlBean other = (ChannelXmlBean) obj; if (currentRelease == null) { if (other.currentRelease != null) return false; } else if (!currentRelease.equals(other.currentRelease)) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true;
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/ArtifactStatus.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/xmlbeans/ChannelXmlBean.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 18 Number of AST nodes: 18
1
if (this == obj)
1
if (this == obj)
2
         return true;
2
            return true;
3
      if (obj == null)
3
        if (obj == null)
4
         return false;
4
            return false;
5
      if (getClass() != obj.getClass())
5
        if (getClass() != obj.getClass())
6
         return false;
6
            return false;
7
      final ArtifactStatus other = (ArtifactStatus) obj;
7
        final ChannelXmlBean other = (ChannelXmlBean) obj;
8
      if (name == null) {
8
        if (currentRelease == null) {
9
         if (other.name != null)
9
            if (other.currentRelease != null)
10
            return false;
10
                return false;
11
      } else if (!name.equals(other.name))
11
        } else if (!currentRelease.equals(other.currentRelease))
12
         return false;
12
            return false;
13
      if (type == null) {
13
        if (name == null) {
14
         if (other.type != null)
14
            if (other.name != null)
15
            return false;
15
                return false;
16
      } else if (!type.equals(other.type))
16
        } else if (!name.equals(other.name))
17
         return false;
17
            return false;
18
      return true;
18
        return true;
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)3.2
Clones locationClones are in different classes
Number of node comparisons67
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this == obj)
    1
    if (this == obj)
    2
    return true;
    2
    return true;
    3
    if (obj == null)
    3
    if (obj == null)
    4
    return false;
    4
    return false;
    5
    if (getClass() != obj.getClass())
    5
    if (getClass() != obj.getClass())
    5
    if (getClass() != obj.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
    5
    if (getClass() != obj.getClass())
    6
    return false;
    6
    return false;
                                                                                                        
    7
    final ChannelXmlBean other = (ChannelXmlBean)obj;
    7
    final ArtifactStatus other = (ArtifactStatus)obj;
                                                                                                        
    8
    if (name == null)
    13
    if (name == null)
    9
    if (other.name != null)
    9
    if (other.name != null)
    14
    if (other.name != null)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatusnet.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBeanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable other.name does not match with type java.lang.String of variable other.name
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus and net.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBean extend a common superclass
    14
    if (other.name != null)
    10
    return false;
    15
    return false;
    11
    else if (!name.equals(other.name))
    11
    else if (!name.equals(other.name))
    16
    else if (!name.equals(other.name))
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatusnet.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBeanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable other.name does not match with type java.lang.String of variable other.name
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus and net.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBean extend a common superclass
    16
    else if (!name.equals(other.name))
    12
    return false;
    17
    return false;
    13
    if (type == null)
    13
    if (type == null)
    8
    if (currentRelease == null)
    Differences
    Expression1Expression2Difference
    typecurrentReleaseVARIABLE_NAME_MISMATCH
    java.lang.Stringnet.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBeanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable currentRelease
    • Make classes java.lang.String and net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean extend a common superclass
    8
    if (currentRelease == null)
    14
    if (other.type != null)
    14
    if (other.type != null)
    9
    if (other.currentRelease != null)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatusnet.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBeanVARIABLE_TYPE_MISMATCH
    typecurrentReleaseVARIABLE_NAME_MISMATCH
    java.lang.Stringnet.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBeanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus and net.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBean extend a common superclass
    Expression other.type cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression other.currentRelease cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    • Make classes java.lang.String and net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean extend a common superclass
    9
    if (other.currentRelease != null)
    15
    return false;
    10
    return false;
    16
    else if (!type.equals(other.type))
    16
    else if (!type.equals(other.type))
    11
    else if (!currentRelease.equals(other.currentRelease))
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatusnet.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBeanVARIABLE_TYPE_MISMATCH
    typecurrentReleaseVARIABLE_NAME_MISMATCH
    java.lang.Stringnet.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBeanVARIABLE_TYPE_MISMATCH
    typecurrentReleaseVARIABLE_NAME_MISMATCH
    java.lang.Stringnet.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBeanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus and net.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBean extend a common superclass
    Expression other.type cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression other.currentRelease cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    • Make classes java.lang.String and net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean extend a common superclass
    Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable currentRelease
    • Make classes java.lang.String and net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean extend a common superclass
    11
    else if (!currentRelease.equals(other.currentRelease))
    17
    return false;
    12
    return false;
    18
    return true;
    18
    return true;
    Precondition Violations (13)
    Row Violation
    1Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()
    2Type java.lang.String of variable other.name does not match with type java.lang.String of variable other.name
    3Type java.lang.String of variable other.name does not match with type java.lang.String of variable other.name
    4Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable currentRelease
    5Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    6Expression other.type cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression other.currentRelease cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    9Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    10Expression other.type cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression other.currentRelease cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type java.lang.String of variable other.type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable other.currentRelease
    13Type java.lang.String of variable type does not match with type net.sourceforge.squirrel_sql.client.update.xmlbeans.ReleaseXmlBean of variable currentRelease