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"); }
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."); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/GenerateKey.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
Method name: void execute() Method name: void validate()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (null == alias) {
1
if (null == mypackage) {
2
            throw new BuildException("alias attribute must be set");
2
            throw new BuildException("Package/module must be set.");
3
        }
3
        }
4
        if (null == storepass) {
4
        if (null == mydestfile) {
5
            throw new BuildException("storepass attribute must be set");
5
            throw new BuildException("Destfile must be set.");
6
        }
6
        }
7
        if (null == dname && null == expandedDname) {
7
        if (null == mystartTag && null == mystartDate) {
8
            throw new BuildException("dname must be set");
8
            throw new BuildException("Start tag or start date 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.8
Clones locationClones are in different classes having the same super class
Number of node comparisons21
  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)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (null == alias)
    1
    if (null == alias)
    1
    if (null == mypackage)
    Differences
    Expression1Expression2Difference
    aliasmypackageVARIABLE_NAME_MISMATCH
    1
    if (null == mypackage)
    2
    throw new BuildException("alias attribute must be set");
    2
    throw new BuildException("alias attribute must be set");
    2
    throw new BuildException("Package/module must be set.");
    Differences
    Expression1Expression2Difference
    "alias attribute must be set""Package/module must be set."LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("Package/module must be set.");
    3
    if (null == storepass)
    3
    if (null == storepass)
    3
    if (null == mydestfile)
    Differences
    Expression1Expression2Difference
    storepassmydestfileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable storepass does not match with type java.io.File of variable mydestfile
    • Make classes java.lang.String and java.io.File extend a common superclass
    3
    if (null == mydestfile)
    4
    throw new BuildException("storepass attribute must be set");
    4
    throw new BuildException("storepass attribute must be set");
    4
    throw new BuildException("Destfile must be set.");
    Differences
    Expression1Expression2Difference
    "storepass attribute must be set""Destfile must be set."LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("Destfile must be set.");
    5
    if (null == dname && null == expandedDname)
    5
    if (null == dname && null == expandedDname)
    5
    if (null == mystartTag && null == mystartDate)
    Differences
    Expression1Expression2Difference
    dnamemystartTagVARIABLE_NAME_MISMATCH
    expandedDnamemystartDateVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.GenerateKey.DistinguishedNamejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.GenerateKey.DistinguishedName of variable expandedDname does not match with type java.lang.String of variable mystartDate
    • Make classes org.apache.tools.ant.taskdefs.GenerateKey.DistinguishedName and java.lang.String extend a common superclass
    5
    if (null == mystartTag && null == mystartDate)
    6
    throw new BuildException("dname must be set");
    6
    throw new BuildException("dname must be set");
    6
    throw new BuildException("Start tag or start date must be set.");
    Differences
    Expression1Expression2Difference
    "dname must be set""Start tag or start date must be set."LITERAL_VALUE_MISMATCH
    6
    throw new BuildException("Start tag or start date must be set.");
    Precondition Violations (2)
    Row Violation
    1Type java.lang.String of variable storepass does not match with type java.io.File of variable mydestfile
    2Type org.apache.tools.ant.taskdefs.GenerateKey.DistinguishedName of variable expandedDname does not match with type java.lang.String of variable mystartDate