if (getCommandLine().getAssertions() != null) { throw new BuildException("Only one assertion declaration is allowed"); } getCommandLine().setAssertions(asserts);
if (getCommandline().getAssertions() != null) { throw new BuildException("Only one assertion declaration is allowed"); } getCommandline().setAssertions(asserts);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Java.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Method name: void addAssertions(Assertions) Method name: void addAssertions(Assertions)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (getCommandLine().getAssertions() != null) {
1
if (getCommandline().getAssertions() != null) {
2
            throw new BuildException("Only one assertion declaration is allowed");
2
            throw new BuildException("Only one assertion declaration is allowed");
3
        }
3
        }
4
        getCommandLine().setAssertions(asserts);
4
        getCommandline().setAssertions(asserts);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (getCommandLine().getAssertions() != null)
    1
    if (getCommandLine().getAssertions() != null)
    1
    if (getCommandline().getAssertions() != null)
    Differences
    Expression1Expression2Difference
    getCommandLinegetCommandlineMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getCommandline() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    if (getCommandline().getAssertions() != null)
    2
    throw new BuildException("Only one assertion declaration is allowed");
    2
    throw new BuildException("Only one assertion declaration is allowed");
    3
    getCommandLine().setAssertions(asserts);
    3
    getCommandLine().setAssertions(asserts);
    3
    getCommandline().setAssertions(asserts);
    Differences
    Expression1Expression2Difference
    getCommandLinegetCommandlineMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getCommandline() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    getCommandline().setAssertions(asserts);
    Precondition Violations (2)
    Row Violation
    1Expression getCommandline() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getCommandline() cannot be parameterized, because it has dependencies to/from statements that will be extracted