XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig() .getRoot().getElement("/options"); forward = composerOptions.getElement("forward"); if (forward == null) { forward = composerOptions.addSubElement("forward"); } // listen for configuration changes forward.addObserver(this);
XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig() .getRoot().getElement("/options"); subject = composerOptions.getElement("subject"); if (subject == null) { subject = composerOptions.addSubElement("subject"); } subject.addObserver(this);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/table/action/ForwardAction.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/SubjectController.java
Method name: void ForwardAction(IFrameMediator) Method name: void SubjectController(ComposerController)
Number of AST nodes: 5 Number of AST nodes: 5
1
XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig()
1
XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig()
2
                                                         .getRoot().getElement("/options");
2
                                                         .getRoot().getElement("/options");
3
        forward = composerOptions.getElement("forward");
3
        subject = composerOptions.getElement("subject");
4
        if (forward == null) {
4
        if (subject == null) {
5
            forward = composerOptions.addSubElement("forward");
5
            subject = composerOptions.addSubElement("subject");
6
        }
6
        }
7
        // listen for configuration changes
7
        
8
        forward.addObserver(this);
8
subject.addObserver(this);
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.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig().getRoot().getElement("/options");
    3
    XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig().getRoot().getElement("/options");
    10
    forward = composerOptions.getElement("forward");
    10
    forward = composerOptions.getElement("forward");
    4
    subject = composerOptions.getElement("subject");
    Differences
    Expression1Expression2Difference
    forwardsubjectVARIABLE_NAME_MISMATCH
    "forward""subject"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression forward is a field being modified, and thus it cannot be parameterized
    Expression subject is a field being modified, and thus it cannot be parameterized
    4
    subject = composerOptions.getElement("subject");
    11
    if (forward == null)
    11
    if (forward == null)
    5
    if (subject == null)
    Differences
    Expression1Expression2Difference
    forwardsubjectVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression forward cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression subject cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if (subject == null)
    12
    forward = composerOptions.addSubElement("forward");
    12
    forward = composerOptions.addSubElement("forward");
    6
    subject = composerOptions.addSubElement("subject");
    Differences
    Expression1Expression2Difference
    forwardsubjectVARIABLE_NAME_MISMATCH
    "forward""subject"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression forward is a field being modified, and thus it cannot be parameterized
    Expression subject is a field being modified, and thus it cannot be parameterized
    6
    subject = composerOptions.addSubElement("subject");
    13
    forward.addObserver(this);
    13
    forward.addObserver(this);
    7
    subject.addObserver(this);
    Differences
    Expression1Expression2Difference
    forwardsubjectVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression forward cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression subject cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    subject.addObserver(this);
    Precondition Violations (8)
    Row Violation
    1Expression forward is a field being modified, and thus it cannot be parameterized
    2Expression subject is a field being modified, and thus it cannot be parameterized
    3Expression forward cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression subject cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression forward is a field being modified, and thus it cannot be parameterized
    6Expression subject is a field being modified, and thus it cannot be parameterized
    7Expression forward cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression subject cannot be parameterized, because it has dependencies to/from statements that will be extracted