for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == IMessageSelectionListener.class) { ((IMessageSelectionListener) listeners[i + 1]).selectionChanged(e); } }
for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == IContainerListener.class) { ((IContainerListener) listeners[i + 1]).switchedComponent(e); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/MessageController.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/DefaultContainer.java
Method name: void fireMessageSelectionChangedEvent(IMailbox, String) Method name: void fireComponentChanged(IFrameMediator)
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = listeners.length - 2; i >= 0; i -= 2) {
1
for (int i = listeners.length - 2; i >= 0; i -= 2) {
2
			if (listeners[i] == IMessageSelectionListener.class) {
2
			if (listeners[i] == IContainerListener.class) {
3
				((IMessageSelectionListener) listeners[i + 1]).selectionChanged(e);
3
				((IContainerListener) listeners[i + 1]).switchedComponent(e);
4
			}
4
			}
5
		}
5
		}
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = listeners.length - 2; i >= 0; i -= 2)
    3
    for (int i = listeners.length - 2; i >= 0; i -= 2)
    4
    if (listeners[i] == IMessageSelectionListener.class)
    4
    if (listeners[i] == IMessageSelectionListener.class)
    4
    if (listeners[i] == IContainerListener.class)
    Differences
    Expression1Expression2Difference
    IMessageSelectionListener.classIContainerListener.classLITERAL_VALUE_MISMATCH
    4
    if (listeners[i] == IContainerListener.class)
    5
    ((IMessageSelectionListener)listeners[i + 1]).selectionChanged(e);
    5
    ((IMessageSelectionListener)listeners[i + 1]).selectionChanged(e);
    5
    ((IContainerListener)listeners[i + 1]).switchedComponent(e);
    Differences
    Expression1Expression2Difference
    org.columba.mail.gui.message.IMessageSelectionEventorg.columba.api.gui.frame.event.FrameEventVARIABLE_TYPE_MISMATCH
    selectionChangedswitchedComponentMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.mail.gui.message.IMessageSelectionListenerorg.columba.api.gui.frame.event.IContainerListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.mail.gui.message.IMessageSelectionEvent of variable e does not match with type org.columba.api.gui.frame.event.FrameEvent of variable e
    • Make classes org.columba.mail.gui.message.IMessageSelectionEvent and org.columba.api.gui.frame.event.FrameEvent extend a common superclass
    Expression ((IMessageSelectionListener)listeners[i + 1]).selectionChanged(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((IContainerListener)listeners[i + 1]).switchedComponent(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ((IMessageSelectionListener)listeners[i + 1]).selectionChanged(e) is a void method call, and thus it cannot be parameterized
    Expression ((IContainerListener)listeners[i + 1]).switchedComponent(e) is a void method call, and thus it cannot be parameterized
    Expression (IMessageSelectionListener)listeners[i + 1] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (IContainerListener)listeners[i + 1] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.columba.mail.gui.message.IMessageSelectionListener does not match with type org.columba.api.gui.frame.event.IContainerListener
    • Make classes org.columba.mail.gui.message.IMessageSelectionListener and org.columba.api.gui.frame.event.IContainerListener extend a common superclass
    5
    ((IContainerListener)listeners[i + 1]).switchedComponent(e);
    Precondition Violations (9)
    Row Violation
    1Type org.columba.mail.gui.message.IMessageSelectionEvent of variable e does not match with type org.columba.api.gui.frame.event.FrameEvent of variable e
    2Expression ((IMessageSelectionListener)listeners[i + 1]).selectionChanged(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ((IContainerListener)listeners[i + 1]).switchedComponent(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression ((IMessageSelectionListener)listeners[i + 1]).selectionChanged(e) is a void method call, and thus it cannot be parameterized
    5Expression ((IContainerListener)listeners[i + 1]).switchedComponent(e) is a void method call, and thus it cannot be parameterized
    6Expression (IMessageSelectionListener)listeners[i + 1] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression (IContainerListener)listeners[i + 1] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type org.columba.mail.gui.message.IMessageSelectionListener does not match with type org.columba.api.gui.frame.event.IContainerListener
    9The refactoring of the clones is infeasible, because classes org.columba.mail.gui.message.MessageController and org.columba.core.gui.frame.DefaultContainer do not have a common superclass