if (nestedSequential == null) { throw new BuildException("Missing sequential element"); } if (name == null) { throw new BuildException("Name not specified"); } name = ProjectHelper.genComponentName(getURI(), name);
if (nestedTask == null) { throw new BuildException("Missing nested element"); } if (name == null) { throw new BuildException("Name not specified"); } name = ProjectHelper.genComponentName(getURI(), name);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/PreSetDef.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 5 Number of AST nodes: 5
1
if (nestedSequential == null) {
1
if (nestedTask == null) {
2
            throw new BuildException("Missing sequential element");
2
            throw new BuildException("Missing nested element");
3
        }
3
        }
4
        if (name == null) {
4
        if (name == null) {
5
            throw new BuildException("Name not specified");
5
            throw new BuildException("Name not specified");
6
        }
6
        }
7
        name = ProjectHelper.genComponentName(getURI(), name);
7
        name = ProjectHelper.genComponentName(getURI(), name);
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)210.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (nestedSequential == null)
    1
    if (nestedSequential == null)
    1
    if (nestedTask == null)
    Differences
    Expression1Expression2Difference
    nestedSequentialnestedTaskVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.MacroDef.NestedSequentialorg.apache.tools.ant.UnknownElementVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.MacroDef.NestedSequential of variable nestedSequential does not match with type org.apache.tools.ant.UnknownElement of variable nestedTask
    • Make classes org.apache.tools.ant.taskdefs.MacroDef.NestedSequential and org.apache.tools.ant.UnknownElement extend a common superclass
    1
    if (nestedTask == null)
    2
    throw new BuildException("Missing sequential element");
    2
    throw new BuildException("Missing sequential element");
    2
    throw new BuildException("Missing nested element");
    Differences
    Expression1Expression2Difference
    "Missing sequential element""Missing nested element"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("Missing nested element");
    3
    if (name == null)
    3
    if (name == null)
    4
    throw new BuildException("Name not specified");
    4
    throw new BuildException("Name not specified");
    5
    name = ProjectHelper.genComponentName(getURI(), name);
    5
    name = ProjectHelper.genComponentName(getURI(), name);
    Precondition Violations (1)
    Row Violation
    1Type org.apache.tools.ant.taskdefs.MacroDef.NestedSequential of variable nestedSequential does not match with type org.apache.tools.ant.UnknownElement of variable nestedTask