if (output != null) { try { BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(output)); outputstream = new PrintStream(bos); } catch (IOException e) { throw new BuildException(e, getLocation()); } } else if (!quiet) { outputstream = new LogOutputStream(this, Project.MSG_INFO); } else { outputstream = new LogOutputStream(this, Project.MSG_DEBUG); }
if (error != null) { try { BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(error)); errorstream = new PrintStream(bos); } catch (IOException e) { throw new BuildException(e, getLocation()); } } else if (!quiet) { errorstream = new LogOutputStream(this, Project.MSG_WARN); } else { errorstream = new LogOutputStream(this, Project.MSG_DEBUG); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/Rpm.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/Rpm.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 7 Number of AST nodes: 7
1
if (output != null) {
1
if (error != null) {
2
                try {
2
                try {
3
                    BufferedOutputStream bos
3
                    BufferedOutputStream bos
4
                        = new BufferedOutputStream(new FileOutputStream(output));
4
                        = new BufferedOutputStream(new FileOutputStream(error));
5
                    outputstream = new PrintStream(bos);
5
                    errorstream = new PrintStream(bos);
6
                } catch (IOException e) {
6
                }  catch (IOException e) {
7
                    throw new BuildException(e, getLocation());
7
                    throw new BuildException(e, getLocation());
8
                }
8
                }
9
            } else if (!quiet) {
9
            } else if (!quiet) {
10
                outputstream = new LogOutputStream(this, Project.MSG_INFO);
10
                errorstream = new LogOutputStream(this, Project.MSG_WARN);
11
            } else {
11
            } else {
12
                outputstream = new LogOutputStream(this, Project.MSG_DEBUG);
12
                errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
13
            }
13
            }
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.4
Clones locationClones are in the same method
Number of node comparisons21
  1. {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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    if (output != null)
    21
    if (output != null)
    28
    if (error != null)
    Differences
    Expression1Expression2Difference
    outputerrorVARIABLE_NAME_MISMATCH
    28
    if (error != null)
    22
    try
    29
    try
    23
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(output));
    23
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(output));
    30
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(error));
    Differences
    Expression1Expression2Difference
    outputerrorVARIABLE_NAME_MISMATCH
    30
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(error));
    24
    outputstream = new PrintStream(bos);
    24
    outputstream = new PrintStream(bos);
    31
    errorstream = new PrintStream(bos);
    Differences
    Expression1Expression2Difference
    outputstreamerrorstreamVARIABLE_NAME_MISMATCH
    31
    errorstream = new PrintStream(bos);
    25
    else if (!quiet)
    32
    else if (!quiet)
    26
    outputstream = new LogOutputStream(this, Project.MSG_INFO);
    26
    outputstream = new LogOutputStream(this, Project.MSG_INFO);
    33
    errorstream = new LogOutputStream(this, Project.MSG_WARN);
    Differences
    Expression1Expression2Difference
    outputstreamerrorstreamVARIABLE_NAME_MISMATCH
    MSG_INFOMSG_WARNVARIABLE_NAME_MISMATCH
    33
    errorstream = new LogOutputStream(this, Project.MSG_WARN);
    else
    else
    27
    outputstream = new LogOutputStream(this, Project.MSG_DEBUG);
    27
    outputstream = new LogOutputStream(this, Project.MSG_DEBUG);
    34
    errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
    Differences
    Expression1Expression2Difference
    outputstreamerrorstreamVARIABLE_NAME_MISMATCH
    34
    errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
    Precondition Violations (0)
    Row Violation