/** * */ private void getConfigurationValues() { XmlElement markasread = MailConfig.getInstance().get("options").getElement("/options/markasread"); // listen for configuration changes markasread.addObserver(this); // get interval value String delayString = markasread.getAttribute("delay", "2"); delay = Integer.parseInt(delayString); // enable timer String enabledString = markasread.getAttribute("enabled", "true"); enabled = enabledString.equals("true") ? true : false; }
public SubjectController(ComposerController controller) { this.controller = controller; view = new SubjectView(this); XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig() .getRoot().getElement("/options"); subject = composerOptions.getElement("subject"); if (subject == null) { subject = composerOptions.addSubElement("subject"); } subject.addObserver(this); String askSubject = subject.getAttribute("ask_if_empty", "true"); if (askSubject.equals("true")) { ask = true; } else { ask = false; } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/MarkAsReadTimer.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/SubjectController.java
Method name: void getConfigurationValues() Method name: void SubjectController(ComposerController)
Number of AST nodes: 1 Number of AST nodes: 3
1
/**
1
public SubjectController(ComposerController controller) {
2
	 * 
2
        this.controller = controller;
3
	 */
3
4
	private void getConfigurationValues() {
4
        view = new SubjectView(this);
5
		XmlElement markasread = MailConfig.getInstance().get("options").getElement("/options/markasread");
5
6
6
        XmlElement composerOptions = MailConfig.getInstance().getComposerOptionsConfig()
7
        // listen for configuration changes
7
                                                         .getRoot().getElement("/options");
8
        markasread.addObserver(this);
8
        subject = composerOptions.getElement("subject");
9
9
10
        // get interval value
10
        if (subject == null) {
11
        String delayString = markasread.getAttribute("delay", "2");
11
            subject = composerOptions.addSubElement("subject");
12
        delay = Integer.parseInt(delayString);
12
        }
13
13
14
        // enable timer
14
        subject.addObserver(this);
15
        String enabledString = markasread.getAttribute("enabled", "true");
15
16
        enabled = enabledString.equals("true") ? true : false;
16
        String askSubject = subject.getAttribute("ask_if_empty", "true");
17
	}
17
18
        if (askSubject.equals("true")) {
19
            ask = true;
20
        } else {
21
            ask = false;
22
        }
23
    }
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score1.000
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    enabled = enabledString.equals("true") ? true : false;
    6
    enabled = enabledString.equals("true") ? true : false;
    9
    if (askSubject.equals("true"))
    Differences
    Expression1Expression2Difference
    enabledStringaskSubjectVARIABLE_NAME_MISMATCH
    enabledaskVARIABLE_NAME_MISMATCH
    enabledaskVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression enabled is a field being modified, and thus it cannot be parameterized
    Expression ask is a field being modified, and thus it cannot be parameterized
    Expression enabled is a field being modified, and thus it cannot be parameterized
    Expression ask is a field being modified, and thus it cannot be parameterized
    9
    if (askSubject.equals("true"))
                              
    10
    ask = true;
    Differences
    Expression1Expression2Difference
    enabledaskVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression enabled is a field being modified, and thus it cannot be parameterized
    Expression ask is a field being modified, and thus it cannot be parameterized
    10
    ask = true;
            
    else
                                
    11
    ask = false;
    Differences
    Expression1Expression2Difference
    enabledaskVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression enabled is a field being modified, and thus it cannot be parameterized
    Expression ask is a field being modified, and thus it cannot be parameterized
    11
    ask = false;
    Precondition Violations (8)
    Row Violation
    1Expression enabled is a field being modified, and thus it cannot be parameterized
    2Expression ask is a field being modified, and thus it cannot be parameterized
    3Expression enabled is a field being modified, and thus it cannot be parameterized
    4Expression ask is a field being modified, and thus it cannot be parameterized
    5Expression enabled is a field being modified, and thus it cannot be parameterized
    6Expression ask is a field being modified, and thus it cannot be parameterized
    7Expression enabled is a field being modified, and thus it cannot be parameterized
    8Expression ask is a field being modified, and thus it cannot be parameterized