if (runner != null) { runner.handleErrorFlush(output); if (showOutput) { super.handleErrorFlush(output); } } else { super.handleErrorFlush(output); }
if (runner != null) { runner.handleFlush(output); if (showOutput) { super.handleFlush(output); } } else { super.handleFlush(output); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Method name: void handleErrorFlush(String) Method name: void handleFlush(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (runner != null) {
1
if (runner != null) {
2
            runner.handleErrorFlush(output);
2
            runner.handleFlush(output);
3
            if (showOutput) {
3
            if (showOutput) {
4
                super.handleErrorFlush(output);
4
                super.handleFlush(output);
5
            }
5
            }
6
        } else {
6
        } else {
7
            super.handleErrorFlush(output);
7
            super.handleFlush(output);
8
        }
8
        }
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 declared in the same class
Number of node comparisons13
  1. {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)9.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (runner != null)
    1
    if (runner != null)
    2
    runner.handleErrorFlush(output);
    2
    runner.handleErrorFlush(output);
    2
    runner.handleFlush(output);
    Differences
    Expression1Expression2Difference
    handleErrorFlushhandleFlushMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression runner.handleErrorFlush(output) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression runner.handleFlush(output) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression runner.handleErrorFlush(output) is a void method call, and thus it cannot be parameterized
    Expression runner.handleFlush(output) is a void method call, and thus it cannot be parameterized
    2
    runner.handleFlush(output);
    3
    if (showOutput)
    3
    if (showOutput)
    4
    super.handleErrorFlush(output);
    4
    super.handleErrorFlush(output);
    4
    super.handleFlush(output);
    Differences
    Expression1Expression2Difference
    handleErrorFlushhandleFlushMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression super.handleErrorFlush(output) is a void method call, and thus it cannot be parameterized
    Expression super.handleFlush(output) is a void method call, and thus it cannot be parameterized
    Super method call super.handleErrorFlush(output); cannot be extracted from method
    Super method call super.handleFlush(output); cannot be extracted from method
    4
    super.handleFlush(output);
    else
    else
    5
    super.handleErrorFlush(output);
    5
    super.handleErrorFlush(output);
    5
    super.handleFlush(output);
    Differences
    Expression1Expression2Difference
    handleErrorFlushhandleFlushMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression super.handleErrorFlush(output) is a void method call, and thus it cannot be parameterized
    Expression super.handleFlush(output) is a void method call, and thus it cannot be parameterized
    Super method call super.handleErrorFlush(output); cannot be extracted from method
    Super method call super.handleFlush(output); cannot be extracted from method
    5
    super.handleFlush(output);
    Precondition Violations (12)
    Row Violation
    1Expression runner.handleErrorFlush(output) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression runner.handleFlush(output) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression runner.handleErrorFlush(output) is a void method call, and thus it cannot be parameterized
    4Expression runner.handleFlush(output) is a void method call, and thus it cannot be parameterized
    5Expression super.handleErrorFlush(output) is a void method call, and thus it cannot be parameterized
    6Expression super.handleFlush(output) is a void method call, and thus it cannot be parameterized
    7Super method call super.handleErrorFlush(output); cannot be extracted from method
    8Super method call super.handleFlush(output); cannot be extracted from method
    9Expression super.handleErrorFlush(output) is a void method call, and thus it cannot be parameterized
    10Expression super.handleFlush(output) is a void method call, and thus it cannot be parameterized
    11Super method call super.handleErrorFlush(output); cannot be extracted from method
    12Super method call super.handleFlush(output); cannot be extracted from method