public void update(Observable arg0, Object arg1) { String askSubject = subject.getAttribute("ask_if_empty", "true"); if (askSubject.equals("true")) { ask = true; } else { ask = false; } }
/** * */ 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; }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/SubjectController.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/MarkAsReadTimer.java
Method name: void update(Observable, Object) Method name: void getConfigurationValues()
Number of AST nodes: 3 Number of AST nodes: 1
1
public void update(Observable arg0, Object arg1) {
1
/**
2
        String askSubject = subject.getAttribute("ask_if_empty", "true");
2
	 * 
3
3
	 */
4
        if (askSubject.equals("true")) {
4
	private void getConfigurationValues() {
5
            ask = true;
5
		XmlElement markasread = MailConfig.getInstance().get("options").getElement("/options/markasread");
6
        } else {
6
7
            ask = false;
7
        // listen for configuration changes
8
        }
8
        markasread.addObserver(this);
9
    }
9
10
        // get interval value
11
        String delayString = markasread.getAttribute("delay", "2");
12
        delay = Integer.parseInt(delayString);
13
14
        // enable timer
15
        String enabledString = markasread.getAttribute("enabled", "true");
16
        enabled = enabledString.equals("true") ? true : false;
17
	}
  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
    2
    if (askSubject.equals("true"))
    2
    if (askSubject.equals("true"))
    6
    enabled = enabledString.equals("true") ? true : false;
    Differences
    Expression1Expression2Difference
    askSubjectenabledStringVARIABLE_NAME_MISMATCH
    askenabledVARIABLE_NAME_MISMATCH
    askenabledVARIABLE_NAME_MISMATCH
    Preondition Violations
    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
    Expression enabled is a field being modified, and thus it cannot be parameterized
    6
    enabled = enabledString.equals("true") ? true : false;
    3
    ask = true;
    3
    ask = true;
    Differences
    Expression1Expression2Difference
    askenabledVARIABLE_NAME_MISMATCH
    Preondition Violations
    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
                            
    else
            
    4
    ask = false;
    4
    ask = false;
    Differences
    Expression1Expression2Difference
    askenabledVARIABLE_NAME_MISMATCH
    Preondition Violations
    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
                              
    Precondition Violations (8)
    Row Violation
    1Expression ask is a field being modified, and thus it cannot be parameterized
    2Expression enabled is a field being modified, and thus it cannot be parameterized
    3Expression ask is a field being modified, and thus it cannot be parameterized
    4Expression enabled is a field being modified, and thus it cannot be parameterized
    5Expression ask is a field being modified, and thus it cannot be parameterized
    6Expression enabled is a field being modified, and thus it cannot be parameterized
    7Expression ask is a field being modified, and thus it cannot be parameterized
    8Expression enabled is a field being modified, and thus it cannot be parameterized