if (mapperElement != null) { throw new BuildException("Cannot define more than one mapper", getLocation()); } mapperElement = new Mapper(getProject()); return mapperElement;
if (mapper != null) { throw new BuildException("Cannot define more than one mapper", getLocation()); } mapper = new Mapper(getProject()); return mapper;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/ExecuteOn.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java
Method name: Mapper createMapper() Method name: Mapper createMapper()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (mapperElement != null) {
1
if (mapper != null) {
2
            throw new BuildException("Cannot define more than one mapper",
2
            throw new BuildException("Cannot define more than one mapper",
3
                                     getLocation());
3
                                     getLocation());
4
        }
4
        }
5
        mapperElement = new Mapper(getProject());
5
        mapper = new Mapper(getProject());
6
        return mapperElement;
6
        return mapper;
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (mapperElement != null)
    1
    if (mapperElement != null)
    1
    if (mapper != null)
    Differences
    Expression1Expression2Difference
    mapperElementmapperVARIABLE_NAME_MISMATCH
    1
    if (mapper != null)
    2
    throw new BuildException("Cannot define more than one mapper", getLocation());
    2
    throw new BuildException("Cannot define more than one mapper", getLocation());
    3
    mapperElement = new Mapper(getProject());
    3
    mapperElement = new Mapper(getProject());
    3
    mapper = new Mapper(getProject());
    Differences
    Expression1Expression2Difference
    mapperElementmapperVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression mapperElement is a field being modified, and thus it cannot be parameterized
    Expression mapper is a field being modified, and thus it cannot be parameterized
    3
    mapper = new Mapper(getProject());
    4
    return mapperElement;
    4
    return mapperElement;
    4
    return mapper;
    Differences
    Expression1Expression2Difference
    mapperElementmapperVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression mapperElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mapper cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return mapper;
    Precondition Violations (4)
    Row Violation
    1Expression mapperElement is a field being modified, and thus it cannot be parameterized
    2Expression mapper is a field being modified, and thus it cannot be parameterized
    3Expression mapperElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression mapper cannot be parameterized, because it has dependencies to/from statements that will be extracted