XmlElement sorting = getConfigNode(folder);
ITableController tableController =((ITableController)((TableViewOwner) getMediator()).getTableController());
String column = tableController.getSortingColumn();
boolean order = tableController.getSortingOrder();
sorting.addAttribute("column", column);
sorting.addAttribute("order", Boolean.toString(order));
Object uid = addMessage();
getSourceFolder().setAttribute(uid, "columba.color", Color.red);
// create filter configuration
MailFilterCriteria criteria = MailFilterFactory.createColorIs(Color.red
.getRGB());
// create filter
ColorFilter filter = new ColorFilter();
// init configuration
filter.setUp(criteria);
// execute filter
boolean result = filter.process(getSourceFolder(), uid);
assertEquals("filter result", true, result);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folderoptions/SortingOptionsPlugin.java
|
|
File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/filter/plugins/ColorFilterTest.java
|
Method name: void saveOptionsToXml(IMailbox)
|
|
Method name: void test()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 7
|
|
1 | XmlElement sorting = getConfigNode(folder);↵ | | |
|
2 | ITableController tableController =((ITableController)((TableViewOwner) getMediator()).getTableController());↵ | | |
|
|
3 | String column = tableControll↵ | | 1 | Object uid = addMessage();↵
|
| | | 2 | getSourceFolder().setAttribute(uid, "columba.color", Color.red);↵
|
|
| | | 3 | // create filter configuration↵
|
| | | 4 | MailFilterCriteria criteria = MailFilterFactory.createColorIs(Color.red↵
|
| | | 5 | .getRGB());↵
|
|
| | | 6 | // create filter↵
|
| | | 7 | ColorFilter filter = new ColorFilter();↵
|
|
| | | 8 | // init configuration↵
|
4 | er.getSortingColumn();↵ | | 9 | filter.set↵
|
5 | boolean order = tableController.getSortingOrder();↵ | | |
|
|
6 | sorting.addAttribute("column", column);↵ | | |
|
7 | sorting.addAttribute("order", Boolean.toString(order)↵ | | 10 | Up(criteria);↵
|
|
| | | 11 | // execute filter↵
|
| | | 12 | boolean result = filter.process(getSourceFolder(), uid);↵
|
8 | ); | | 13 | assertEquals("filter result", true, result);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 42 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 0 |
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 |
Clone type | Unknown type |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
Precondition Violations (0)
Row |
Violation |