OutputStream os = this.getOutputStream(); try { os.write((s + "\n").getBytes()); if (echoString) { log(s, Project.MSG_INFO); } os.flush(); } catch (Exception e) { throw new BuildException(e, getLocation()); }
OutputStream os = this.getOutputStream(); try { os.write((s + "\n").getBytes()); if (echoString) { log(s, Project.MSG_INFO); } os.flush(); } catch (Exception e) { throw new BuildException(e, getLocation()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
Method name: void sendString(String, boolean) Method name: void sendString(String, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
OutputStream os = this.getOutputStream();
1
OutputStream os = this.getOutputStream();
2
            try {
2
            try {
3
                os.write((s + "\n").getBytes());
3
                os.write((s + "\n").getBytes());
4
                if (echoString) {
4
                if (echoString) {
5
                    log(s, Project.MSG_INFO);
5
                    log(s, Project.MSG_INFO);
6
                }
6
                }
7
                os.flush();
7
                os.flush();
8
            } catch (Exception e) {
8
            } catch (Exception e) {
9
                throw new BuildException(e, getLocation());
9
                throw new BuildException(e, getLocation());
10
            }
10
            }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.6
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    OutputStream os = this.getOutputStream();
    1
    OutputStream os = this.getOutputStream();
    2
    try
    2
    try
    3
    os.write((s + "\n").getBytes());
    3
    os.write((s + "\n").getBytes());
    4
    if (echoString)
    4
    if (echoString)
    5
    log(s, Project.MSG_INFO);
    5
    log(s, Project.MSG_INFO);
    6
    os.flush();
    6
    os.flush();
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes org.apache.tools.ant.taskdefs.optional.net.RExecTask.AntRExecClient and org.apache.tools.ant.taskdefs.optional.net.TelnetTask.AntTelnetClient do not have a common superclass