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); }
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); }
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 (error != null) {
1
if (output != null) {
2
                try {
2
                try {
3
                    BufferedOutputStream bos
3
                    BufferedOutputStream bos
4
                        = new BufferedOutputStream(new FileOutputStream(error));
4
                        = new BufferedOutputStream(new FileOutputStream(output));
5
                    errorstream = new PrintStream(bos);
5
                    outputstream = 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
                errorstream = new LogOutputStream(this, Project.MSG_WARN);
10
                outputstream = new LogOutputStream(this, Project.MSG_INFO);
11
            } else {
11
            } else {
12
                errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
12
                outputstream = 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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    28
    if (error != null)
    28
    if (error != null)
    21
    if (output != null)
    Differences
    Expression1Expression2Difference
    erroroutputVARIABLE_NAME_MISMATCH
    21
    if (output != null)
    29
    try
    22
    try
    30
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(error));
    30
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(error));
    23
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(output));
    Differences
    Expression1Expression2Difference
    erroroutputVARIABLE_NAME_MISMATCH
    23
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(output));
    31
    errorstream = new PrintStream(bos);
    31
    errorstream = new PrintStream(bos);
    24
    outputstream = new PrintStream(bos);
    Differences
    Expression1Expression2Difference
    errorstreamoutputstreamVARIABLE_NAME_MISMATCH
    24
    outputstream = new PrintStream(bos);
    32
    else if (!quiet)
    25
    else if (!quiet)
    33
    errorstream = new LogOutputStream(this, Project.MSG_WARN);
    33
    errorstream = new LogOutputStream(this, Project.MSG_WARN);
    26
    outputstream = new LogOutputStream(this, Project.MSG_INFO);
    Differences
    Expression1Expression2Difference
    errorstreamoutputstreamVARIABLE_NAME_MISMATCH
    MSG_WARNMSG_INFOVARIABLE_NAME_MISMATCH
    26
    outputstream = new LogOutputStream(this, Project.MSG_INFO);
    else
    else
    34
    errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
    34
    errorstream = new LogOutputStream(this, Project.MSG_DEBUG);
    27
    outputstream = new LogOutputStream(this, Project.MSG_DEBUG);
    Differences
    Expression1Expression2Difference
    errorstreamoutputstreamVARIABLE_NAME_MISMATCH
    27
    outputstream = new LogOutputStream(this, Project.MSG_DEBUG);
    Precondition Violations (0)
    Row Violation