if (null == mypackage) { throw new BuildException("Package/module must be set."); } if (null == mydestfile) { throw new BuildException("Destfile must be set."); } if (null == mystartTag && null == mystartDate) { throw new BuildException("Start tag or start date must be set."); }
if (null == alias) { throw new BuildException("alias attribute must be set"); } if (null == storepass) { throw new BuildException("storepass attribute must be set"); } if (null == dname && null == expandedDname) { throw new BuildException("dname must be set"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/GenerateKey.java
Method name: void validate() Method name: void execute()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (null == mypackage) {
1
if (null == alias) {
2
            throw new BuildException("Package/module must be set.");
2
            throw new BuildException("alias attribute must be set");
3
        }
3
        }
4
        if (null == mydestfile) {
4
        if (null == storepass) {
5
            throw new BuildException("Destfile must be set.");
5
            throw new BuildException("storepass attribute must be set");
6
        }
6
        }
7
        if (null == mystartTag && null == mystartDate) {
7
        if (null == dname && null == expandedDname) {
8
            throw new BuildException("Start tag or start date must be set.");
8
            throw new BuildException("dname must be set");
9
        }
9
        }
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (null == mypackage)
    1
    if (null == mypackage)
    1
    if (null == alias)
    Differences
    Expression1Expression2Difference
    mypackagealiasVARIABLE_NAME_MISMATCH
    1
    if (null == alias)
    2
    throw new BuildException("Package/module must be set.");
    2
    throw new BuildException("Package/module must be set.");
    2
    throw new BuildException("alias attribute must be set");
    Differences
    Expression1Expression2Difference
    "Package/module must be set.""alias attribute must be set"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("alias attribute must be set");
    3
    if (null == mydestfile)
    3
    if (null == mydestfile)
    3
    if (null == storepass)
    Differences
    Expression1Expression2Difference
    mydestfilestorepassVARIABLE_NAME_MISMATCH
    java.io.Filejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.File of variable mydestfile does not match with type java.lang.String of variable storepass
    • Make classes java.io.File and java.lang.String extend a common superclass
    3
    if (null == storepass)
    4
    throw new BuildException("Destfile must be set.");
    4
    throw new BuildException("Destfile must be set.");
    4
    throw new BuildException("storepass attribute must be set");
    Differences
    Expression1Expression2Difference
    "Destfile must be set.""storepass attribute must be set"LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("storepass attribute must be set");
    5
    if (null == mystartTag && null == mystartDate)
    5
    if (null == mystartTag && null == mystartDate)
    5
    if (null == dname && null == expandedDname)
    Differences
    Expression1Expression2Difference
    mystartTagdnameVARIABLE_NAME_MISMATCH
    mystartDateexpandedDnameVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.apache.tools.ant.taskdefs.GenerateKey.DistinguishedNameVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable mystartDate does not match with type org.apache.tools.ant.taskdefs.GenerateKey.DistinguishedName of variable expandedDname
    • Make classes java.lang.String and org.apache.tools.ant.taskdefs.GenerateKey.DistinguishedName extend a common superclass
    5
    if (null == dname && null == expandedDname)
    6
    throw new BuildException("Start tag or start date must be set.");
    6
    throw new BuildException("Start tag or start date must be set.");
    6
    throw new BuildException("dname must be set");
    Differences
    Expression1Expression2Difference
    "Start tag or start date must be set.""dname must be set"LITERAL_VALUE_MISMATCH
    6
    throw new BuildException("dname must be set");
    Precondition Violations (2)
    Row Violation
    1Type java.io.File of variable mydestfile does not match with type java.lang.String of variable storepass
    2Type java.lang.String of variable mystartDate does not match with type org.apache.tools.ant.taskdefs.GenerateKey.DistinguishedName of variable expandedDname