e = replyToList.elements(); while (e.hasMoreElements()) { mailMessage.replyto(e.nextElement().toString()); } e = toList.elements(); while (e.hasMoreElements()) { mailMessage.to(e.nextElement().toString()); }
e = ccList.elements(); while (e.hasMoreElements()) { msg.cc(e.nextElement().toString()); } e = bccList.elements(); while (e.hasMoreElements()) { msg.bcc(e.nextElement().toString()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/email/PlainMailer.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/mail/MailMessageTest.java
Method name: void send() Method name: void run()
Number of AST nodes: 6 Number of AST nodes: 6
1
e = replyToList.elements();
1
e = ccList.elements();
2
            while (e.hasMoreElements()) {
2
                while (e.hasMoreElements()) {
3
                mailMessage.replyto(e.nextElement().toString());
3
                    msg.cc(e.nextElement().toString());
4
            }
4
                }
5
            e = toList.elements();
5
                e = bccList.elements();
6
            while (e.hasMoreElements()) {
6
                while (e.hasMoreElements()) {
7
                mailMessage.to(e.nextElement().toString());
7
                    msg.bcc(e.nextElement().toString());
8
            }
8
                }
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.3
Clones locationClones are in different classes
Number of node comparisons22
  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)63.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    e = replyToList.elements();
    5
    e = replyToList.elements();
    19
    e = ccList.elements();
    Differences
    Expression1Expression2Difference
    replyToListccListVARIABLE_NAME_MISMATCH
    19
    e = ccList.elements();
    6
    while (e.hasMoreElements())
    20
    while (e.hasMoreElements())
    7
    mailMessage.replyto(e.nextElement().toString());
    7
    mailMessage.replyto(e.nextElement().toString());
    21
    msg.cc(e.nextElement().toString());
    Differences
    Expression1Expression2Difference
    replytoccMETHOD_INVOCATION_NAME_MISMATCH
    mailMessagemsgVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression mailMessage.replyto(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression msg.cc(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mailMessage.replyto(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    Expression msg.cc(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    21
    msg.cc(e.nextElement().toString());
    8
    e = toList.elements();
    8
    e = toList.elements();
    22
    e = bccList.elements();
    Differences
    Expression1Expression2Difference
    toListbccListVARIABLE_NAME_MISMATCH
    22
    e = bccList.elements();
    9
    while (e.hasMoreElements())
    23
    while (e.hasMoreElements())
    10
    mailMessage.to(e.nextElement().toString());
    10
    mailMessage.to(e.nextElement().toString());
    24
    msg.bcc(e.nextElement().toString());
    Differences
    Expression1Expression2Difference
    tobccMETHOD_INVOCATION_NAME_MISMATCH
    mailMessagemsgVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression mailMessage.to(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression msg.bcc(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mailMessage.to(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    Expression msg.bcc(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    24
    msg.bcc(e.nextElement().toString());
    Precondition Violations (9)
    Row Violation
    1Expression mailMessage.replyto(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression msg.cc(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression mailMessage.replyto(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    4Expression msg.cc(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    5Expression mailMessage.to(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression msg.bcc(e.nextElement().toString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression mailMessage.to(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    8Expression msg.bcc(e.nextElement().toString()) is a void method call, and thus it cannot be parameterized
    9The refactoring of the clones is infeasible, because classes org.apache.tools.ant.taskdefs.email.PlainMailer and org.apache.tools.mail.MailMessageTest.ClientThread do not have a common superclass