System.out.println("input=" + input); // create stream from string InputStream inputStream = FolderTstHelper .getByteArrayInputStream(input); // add stream to folder Object uid = getSourceFolder().addMessage(inputStream); // create Command reference MailFolderCommandReference ref = new MailFolderCommandReference( getSourceFolder(), new Object[] { uid }); // create copy command ForwardInlineCommand command = new ForwardInlineCommand(ref); // execute command -> use mock object class as worker which does // nothing command.execute(NullWorkerStatusController.getInstance()); // model should contain the data ComposerModel model = command.getModel(); String subject = model.getSubject();
System.out.println("input=" + input); // create stream from string InputStream inputStream = FolderTstHelper .getByteArrayInputStream(input); // add stream to folder Object uid = getSourceFolder().addMessage(inputStream); // create Command reference MailFolderCommandReference ref = new MailFolderCommandReference( getSourceFolder(), new Object[] { uid }); // create copy command ReplyCommand command = new ReplyCommand(ref); // execute command -> use mock object class as worker which does // nothing command.execute(NullWorkerStatusController.getInstance()); // model should contain the data ComposerModel model = command.getModel(); String subject = model.getSubject();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/command/ForwardInlineCommandTest.java File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/command/ReplyCommandTest.java
Method name: void test() Method name: void test()
Number of AST nodes: 8 Number of AST nodes: 8
1
System.out.println("input=" + input);
1
System.out.println("input=" + input);
2
        // create stream from string
2
        // create stream from string
3
        InputStream inputStream = FolderTstHelper
3
        InputStream inputStream = FolderTstHelper
4
                .getByteArrayInputStream(input);
4
                .getByteArrayInputStream(input);
5
        // add stream to folder
5
        // add stream to folder
6
        Object uid = getSourceFolder().addMessage(inputStream);
6
        Object uid = getSourceFolder().addMessage(inputStream);
7
//      create Command reference
7
//      create Command reference
8
        MailFolderCommandReference ref = new MailFolderCommandReference(
8
        MailFolderCommandReference ref = new MailFolderCommandReference(
9
				getSourceFolder(), new Object[] { uid });
9
				getSourceFolder(), new Object[] { uid });
10
        // create copy command
10
        // create copy command
11
        ForwardInlineCommand command = new ForwardInlineCommand(ref);
11
        ReplyCommand command = new ReplyCommand(ref);
12
        // execute command -> use mock object class as worker which does
12
        // execute command -> use mock object class as worker which does
13
        // nothing
13
        // nothing
14
        command.execute(NullWorkerStatusController.getInstance());
14
        command.execute(NullWorkerStatusController.getInstance());
15
        
15
        // model should contain the data
16
        // model should contain the data
16
        ComposerModel model = command.getModel();
17
        ComposerModel model = command.getModel();
18
        
17
        String subject = model.getSubject();
19
        String subject = model.getSubject();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    System.out.println("input=" + input);
    2
    System.out.println("input=" + input);
    3
    InputStream inputStream = FolderTstHelper.getByteArrayInputStream(input);
    3
    InputStream inputStream = FolderTstHelper.getByteArrayInputStream(input);
    4
    Object uid = getSourceFolder().addMessage(inputStream);
    4
    Object uid = getSourceFolder().addMessage(inputStream);
    5
    MailFolderCommandReference ref = new MailFolderCommandReference(getSourceFolder(), new Object[] {uid});
    5
    MailFolderCommandReference ref = new MailFolderCommandReference(getSourceFolder(), new Object[] {uid});
    6
    ForwardInlineCommand command = new ForwardInlineCommand(ref);
    6
    ForwardInlineCommand command = new ForwardInlineCommand(ref);
    6
    ReplyCommand command = new ReplyCommand(ref);
    Differences
    Expression1Expression2Difference
    org.columba.mail.gui.composer.command.ForwardInlineCommandorg.columba.mail.gui.composer.command.ReplyCommandSUBCLASS_TYPE_MISMATCH
    org.columba.mail.gui.composer.command.ForwardInlineCommandorg.columba.mail.gui.composer.command.ReplyCommandSUBCLASS_TYPE_MISMATCH
    org.columba.mail.gui.composer.command.ForwardInlineCommandorg.columba.mail.gui.composer.command.ReplyCommandSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new ForwardInlineCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new ReplyCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    ReplyCommand command = new ReplyCommand(ref);
    7
    command.execute(NullWorkerStatusController.getInstance());
    7
    command.execute(NullWorkerStatusController.getInstance());
    7
    command.execute(NullWorkerStatusController.getInstance());
    Differences
    Expression1Expression2Difference
    org.columba.mail.gui.composer.command.ForwardInlineCommandorg.columba.mail.gui.composer.command.ReplyCommandSUBCLASS_TYPE_MISMATCH
    7
    command.execute(NullWorkerStatusController.getInstance());
    8
    ComposerModel model = command.getModel();
    8
    ComposerModel model = command.getModel();
    8
    ComposerModel model = command.getModel();
    Differences
    Expression1Expression2Difference
    org.columba.mail.gui.composer.command.ForwardInlineCommandorg.columba.mail.gui.composer.command.ReplyCommandSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression command cannot be unified with expression command , because common superclass org.columba.core.command.Command does not declare member(s) public org.columba.mail.gui.composer.ComposerModel getModel()
    8
    ComposerModel model = command.getModel();
    9
    String subject = model.getSubject();
    9
    String subject = model.getSubject();
    Precondition Violations (3)
    Row Violation
    1Expression new ForwardInlineCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new ReplyCommand(ref) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression command cannot be unified with expression command , because common superclass org.columba.core.command.Command does not declare member(s) public org.columba.mail.gui.composer.ComposerModel getModel()