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 | } |
See real code fragment |
|
See real code fragment |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 1.000 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | if (askSubject.equals("true")) | | 6 | enabled = enabledString.equals("true") ? true : false; |
3 | | | | |
| | | | |
4 | | | | |
Precondition Violations (8)
Row |
Violation |
1 | Expression ask is a field being modified, and thus it cannot be parameterized |
2 | Expression enabled is a field being modified, and thus it cannot be parameterized |
3 | Expression ask is a field being modified, and thus it cannot be parameterized |
4 | Expression enabled is a field being modified, and thus it cannot be parameterized |
5 | Expression ask is a field being modified, and thus it cannot be parameterized |
6 | Expression enabled is a field being modified, and thus it cannot be parameterized |
7 | Expression ask is a field being modified, and thus it cannot be parameterized |
8 | Expression enabled is a field being modified, and thus it cannot be parameterized |