try { mailer = (Mailer) ClasspathUtils.newInstance( "org.apache.tools.ant.taskdefs.email.MimeMailer", EmailTask.class.getClassLoader(), Mailer.class); autoFound = true; log("Using MIME mail", Project.MSG_VERBOSE); } catch (BuildException e) { Throwable t = e.getCause() == null ? e : e.getCause(); log("Failed to initialise MIME mail: " + t.getMessage(), Project.MSG_WARN); return; }
try { mailer = (Mailer) ClasspathUtils.newInstance( "org.apache.tools.ant.taskdefs.email.UUMailer", EmailTask.class.getClassLoader(), Mailer.class); autoFound = true; log("Using UU mail", Project.MSG_VERBOSE); } catch (BuildException e) { Throwable t = e.getCause() == null ? e : e.getCause(); log("Failed to initialise UU mail: " + t.getMessage(), Project.MSG_WARN); return; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/email/EmailTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/email/EmailTask.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 4 Number of AST nodes: 4
1
try {
1
try {
2
                    mailer = (Mailer) ClasspathUtils.newInstance(
2
                    mailer = (Mailer) ClasspathUtils.newInstance(
3
                            "org.apache.tools.ant.taskdefs.email.MimeMailer",
3
                            "org.apache.tools.ant.taskdefs.email.UUMailer",
4
                            EmailTask.class.getClassLoader(), Mailer.class);
4
                            EmailTask.class.getClassLoader(), Mailer.class);
5
                    autoFound = true;
5
                    autoFound = true;
6
                    log("Using MIME mail", Project.MSG_VERBOSE);
6
                    log("Using UU mail", Project.MSG_VERBOSE);
7
                } catch (BuildException e) {
7
                } catch (BuildException e) {
8
                    Throwable t = e.getCause() == null ? e : e.getCause();
8
                    Throwable t = e.getCause() == null ? e : e.getCause();
9
                    log("Failed to initialise MIME mail: " + t.getMessage(),
9
                    log("Failed to initialise UU mail: " + t.getMessage(),
10
                            Project.MSG_WARN);
10
                            Project.MSG_WARN);
11
                    return;
11
                    return;
12
                }
12
                }
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.9
Clones locationClones are in the same method
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    try
    6
    try
    15
    try
    Differences
    Expression1Expression2Difference
    "Failed to initialise MIME mail: ""Failed to initialise UU mail: "LITERAL_VALUE_MISMATCH
    15
    try
    7
    mailer = (Mailer)ClasspathUtils.newInstance("org.apache.tools.ant.taskdefs.email.MimeMailer", EmailTask.class.getClassLoader(), Mailer.class);
    7
    mailer = (Mailer)ClasspathUtils.newInstance("org.apache.tools.ant.taskdefs.email.MimeMailer", EmailTask.class.getClassLoader(), Mailer.class);
    16
    mailer = (Mailer)ClasspathUtils.newInstance("org.apache.tools.ant.taskdefs.email.UUMailer", EmailTask.class.getClassLoader(), Mailer.class);
    Differences
    Expression1Expression2Difference
    "org.apache.tools.ant.taskdefs.email.MimeMailer""org.apache.tools.ant.taskdefs.email.UUMailer"LITERAL_VALUE_MISMATCH
    16
    mailer = (Mailer)ClasspathUtils.newInstance("org.apache.tools.ant.taskdefs.email.UUMailer", EmailTask.class.getClassLoader(), Mailer.class);
    8
    autoFound = true;
    17
    autoFound = true;
    9
    log("Using MIME mail", Project.MSG_VERBOSE);
    9
    log("Using MIME mail", Project.MSG_VERBOSE);
    18
    log("Using UU mail", Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    "Using MIME mail""Using UU mail"LITERAL_VALUE_MISMATCH
    18
    log("Using UU mail", Project.MSG_VERBOSE);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables autoFound, mailer , while Clone fragment #2 returns variables autoFound, mailer