Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == IFrameMediatorListener.class) { ((IFrameMediatorListener) listeners[i + 1]) .switchedComponent(e); } }
Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == IFolderListener.class) { ((IFolderListener) listeners[i + 1]).messageRemoved(e); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/DefaultFrameController.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/AbstractMessageFolder.java
Method name: void fireComponentChanged() Method name: void fireMessageRemoved(Object, Flags)
Number of AST nodes: 4 Number of AST nodes: 4
1
Object[] listeners = listenerList.getListenerList();
1
Object[] listeners = listenerList.getListenerList();
2
		// Process the listeners last to first, notifying
2
		// Process the listeners last to first, notifying
3
		// those that are interested in this event
3
		// those that are interested in this event
4
		for (int i = listeners.length - 2; i >= 0; i -= 2) {
4
		for (int i = listeners.length - 2; i >= 0; i -= 2) {
5
			if (listeners[i] == IFrameMediatorListener.class) {
5
			if (listeners[i] == IFolderListener.class) {
6
				((IFrameMediatorListener) listeners[i + 1])
6
				((IFolderListener) listeners[i + 1])
7
						.switchedComponent(e);
7
.messageRemoved(e);
8
			}
8
			}
9
		}
9
		}
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.3
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    Object[] listeners = listenerList.getListenerList();
    11
    Object[] listeners = listenerList.getListenerList();
    3
    for (int i = listeners.length - 2; i >= 0; i -= 2)
    12
    for (int i = listeners.length - 2; i >= 0; i -= 2)
    4
    if (listeners[i] == IFrameMediatorListener.class)
    13
    if (listeners[i] == IFolderListener.class)
    5
    ((IFrameMediatorListener)listeners[i + 1]).switchedComponent(e);
    5
    ((IFrameMediatorListener)listeners[i + 1]).switchedComponent(e);
    Preondition Violations
    Unmatched statement ((IFrameMediatorListener)listeners[i + 1]).switchedComponent(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                          
                                                                                                                        
    14
    ((IFolderListener)listeners[i + 1]).messageRemoved(e);
    Preondition Violations
    Unmatched statement ((IFolderListener)listeners[i + 1]).messageRemoved(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14
    ((IFolderListener)listeners[i + 1]).messageRemoved(e);
    Precondition Violations (3)
    Row Violation
    1Unmatched statement ((IFrameMediatorListener)listeners[i + 1]).switchedComponent(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ((IFolderListener)listeners[i + 1]).messageRemoved(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables listeners, i , while Clone fragment #2 returns variables listeners, i