MailFolderCommandReference ref = new MailFolderCommandReference(
getSourceFolder(), getDestFolder(), new Object[] { uid });
// create copy command
MoveMessageCommand command = new MoveMessageCommand(ref);
// execute command -> use mock object class as worker which does nothing
command.execute(NullWorkerStatusController.getInstance());
MailFolderCommandReference ref = new MailFolderCommandReference(
getSourceFolder(), getDestFolder(), new Object[] { uid });
// create copy command
CopyMessageCommand command = new CopyMessageCommand(ref);
// execute command -> use mock object class as worker which does
// nothing
command.execute(NullWorkerStatusController.getInstance());
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/folder/command/MoveMessageTest.java
|
|
File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/folder/command/CopyMessageCommandTest.java
|
Method name: void testMoveMessage()
|
|
Method name: void testCopyMessageAttribute()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | MailFolderCommandReference ref = new MailFolderCommandReference(↵ | | 1 | MailFolderCommandReference ref = new MailFolderCommandReference(↵
|
2 | getSourceFolder(), getDestFolder(), new Object[] { uid });↵ | | 2 | getSourceFolder(), getDestFolder(), new Object[] { uid });↵
|
|
3 | // create copy command↵ | | 3 | // create copy command↵
|
4 | MoveMessageCommand command = new MoveMessageCommand(ref);↵ | | 4 | CopyMessageCommand command = new CopyMessageCommand(ref);↵
|
|
5 | // execute command -> use mock object class as worker which does↵ | | 5 | // execute command -> use mock object class as worker which does↵
|
6 | nothing↵ | | 6 | // nothing↵
|
7 | command.execute(NullWorkerStatusController.getInstance()); | | 7 | command.execute(NullWorkerStatusController.getInstance());
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 5 |
-
{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 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | MailFolderCommandReference ref = new MailFolderCommandReference(getSourceFolder(), getDestFolder(), new Object[] {uid}); | | 7 | MailFolderCommandReference ref = new MailFolderCommandReference(getSourceFolder(), getDestFolder(), new Object[] {uid}); |
6 | MoveMessageCommand command = new MoveMessageCommand(ref); | | 8 | CopyMessageCommand command = new CopyMessageCommand(ref); |
7 | command.execute(NullWorkerStatusController.getInstance()); | | 9 | command.execute(NullWorkerStatusController.getInstance()); |
Precondition Violations (2)
Row |
Violation |
1 | Expression new MoveMessageCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new CopyMessageCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted |