IMailFolderCommandReference ref = mediator.getSelectedReference(); if (attachmentViewer != null) { address = attachmentViewer.getSelected(); } CommandProcessor.getInstance().addOp( new OpenAttachmentCommand(new MailFolderCommandReference(ref .getSourceFolder(), ref.getUids(), address)));
IMailFolderCommandReference ref = mediator.getSelectedReference(); if (attachmentViewer != null) address = attachmentViewer.getSelected(); CommandProcessor.getInstance().addOp( new SaveAttachmentAsCommand(new MailFolderCommandReference(ref .getSourceFolder(), ref.getUids(), address)));
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/action/OpenAttachmentAction.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/action/SaveAsAttachmentAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 4 Number of AST nodes: 4
1
IMailFolderCommandReference ref = mediator.getSelectedReference();
1
IMailFolderCommandReference ref = mediator.getSelectedReference();
2
		if (attachmentViewer != null) {
2
		if (attachmentViewer != null)
3
			address = attachmentViewer.getSelected();
3
			address = attachmentViewer.getSelected();
4
		}
5
		CommandProcessor.getInstance().addOp(
4
		CommandProcessor.getInstance().addOp(
6
				new OpenAttachmentCommand(new MailFolderCommandReference(ref
5
				new SaveAttachmentAsCommand(new MailFolderCommandReference(ref
7
						.getSourceFolder(), ref.getUids(), address)));
6
						.getSourceFolder(), ref.getUids(), address)));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    IMailFolderCommandReference ref = mediator.getSelectedReference();
    1
    IMailFolderCommandReference ref = mediator.getSelectedReference();
    2
    if (attachmentViewer != null)
    2
    if (attachmentViewer != null)
    3
    address = attachmentViewer.getSelected();
    3
    address = attachmentViewer.getSelected();
    4
    CommandProcessor.getInstance().addOp(new OpenAttachmentCommand(new MailFolderCommandReference(ref.getSourceFolder(), ref.getUids(), address)));
    4
    CommandProcessor.getInstance().addOp(new OpenAttachmentCommand(new MailFolderCommandReference(ref.getSourceFolder(), ref.getUids(), address)));
    4
    CommandProcessor.getInstance().addOp(new SaveAttachmentAsCommand(new MailFolderCommandReference(ref.getSourceFolder(), ref.getUids(), address)));
    Differences
    Expression1Expression2Difference
    org.columba.mail.gui.message.command.OpenAttachmentCommandorg.columba.mail.gui.message.command.SaveAttachmentAsCommandSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new OpenAttachmentCommand(new MailFolderCommandReference(ref.getSourceFolder(),ref.getUids(),address)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new SaveAttachmentAsCommand(new MailFolderCommandReference(ref.getSourceFolder(),ref.getUids(),address)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    CommandProcessor.getInstance().addOp(new SaveAttachmentAsCommand(new MailFolderCommandReference(ref.getSourceFolder(), ref.getUids(), address)));
    Precondition Violations (2)
    Row Violation
    1Expression new OpenAttachmentCommand(new MailFolderCommandReference(ref.getSourceFolder(),ref.getUids(),address)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new SaveAttachmentAsCommand(new MailFolderCommandReference(ref.getSourceFolder(),ref.getUids(),address)) cannot be parameterized, because it has dependencies to/from statements that will be extracted