if (isReference()) { throw noChildrenAllowed(); } if (this.inputMapper != null) { if (usingInput) { throw new BuildException("attribute \"input\"" + " cannot coexist with a nested <inputmapper>"); } else { throw new BuildException("Cannot have > 1 <inputmapper>"); } } this.inputMapper = inputMapper;
if (isReference()) { throw noChildrenAllowed(); } if (this.outputMapper != null) { if (usingOutput) { throw new BuildException("attribute \"output\"" + " cannot coexist with a nested <outputmapper>"); } else { throw new BuildException("Cannot have > 1 <outputmapper>"); } } this.outputMapper = outputMapper;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/RedirectorElement.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/RedirectorElement.java
Method name: void addConfiguredInputMapper(Mapper) Method name: void addConfiguredOutputMapper(Mapper)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (isReference()) {
1
if (isReference()) {
2
            throw noChildrenAllowed();
2
            throw noChildrenAllowed();
3
        }
3
        }
4
        if (this.inputMapper != null) {
4
        if (this.outputMapper != null) {
5
            if (usingInput) {
5
            if (usingOutput) {
6
                throw new BuildException("attribute \"input\""
6
                throw new BuildException("attribute \"output\""
7
                    + " cannot coexist with a nested <inputmapper>");
7
                    + " cannot coexist with a nested <outputmapper>");
8
            } else {
8
            } else {
9
                throw new BuildException("Cannot have > 1 <inputmapper>");
9
                throw new BuildException("Cannot have > 1 <outputmapper>");
10
            }
10
            }
11
        }
11
        }
12
        this.inputMapper = inputMapper;
12
        this.outputMapper = outputMapper;
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.3
Clones locationClones are declared in the same class
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isReference())
    1
    if (isReference())
    2
    throw noChildrenAllowed();
    2
    throw noChildrenAllowed();
    3
    if (this.inputMapper != null)
    3
    if (this.inputMapper != null)
    3
    if (this.outputMapper != null)
    Differences
    Expression1Expression2Difference
    inputMapperoutputMapperVARIABLE_NAME_MISMATCH
    3
    if (this.outputMapper != null)
    4
    if (usingInput)
    4
    if (usingInput)
    4
    if (usingOutput)
    Differences
    Expression1Expression2Difference
    usingInputusingOutputVARIABLE_NAME_MISMATCH
    4
    if (usingOutput)
    5
    throw new BuildException("attribute \"input\"" + " cannot coexist with a nested <inputmapper>");
    5
    throw new BuildException("attribute \"input\"" + " cannot coexist with a nested <inputmapper>");
    5
    throw new BuildException("attribute \"output\"" + " cannot coexist with a nested <outputmapper>");
    Differences
    Expression1Expression2Difference
    "attribute \"input\"""attribute \"output\""LITERAL_VALUE_MISMATCH
    " cannot coexist with a nested "" cannot coexist with a nested "LITERAL_VALUE_MISMATCH
    5
    throw new BuildException("attribute \"output\"" + " cannot coexist with a nested <outputmapper>");
    else
    else
    6
    throw new BuildException("Cannot have > 1 <inputmapper>");
    6
    throw new BuildException("Cannot have > 1 <inputmapper>");
    6
    throw new BuildException("Cannot have > 1 <outputmapper>");
    Differences
    Expression1Expression2Difference
    "Cannot have > 1 ""Cannot have > 1 "LITERAL_VALUE_MISMATCH
    6
    throw new BuildException("Cannot have > 1 <outputmapper>");
    7
    this.inputMapper = inputMapper;
    7
    this.inputMapper = inputMapper;
    7
    this.outputMapper = outputMapper;
    Differences
    Expression1Expression2Difference
    inputMapperoutputMapperVARIABLE_NAME_MISMATCH
    inputMapperoutputMapperVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.inputMapper is a field being modified, and thus it cannot be parameterized
    Expression this.outputMapper is a field being modified, and thus it cannot be parameterized
    7
    this.outputMapper = outputMapper;
    Precondition Violations (2)
    Row Violation
    1Expression this.inputMapper is a field being modified, and thus it cannot be parameterized
    2Expression this.outputMapper is a field being modified, and thus it cannot be parameterized