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] == ITagListener.class) { ((ITagListener) listeners[i + 1]).tagChanged(e); } } } /** * @param id */ protected void fireTagAddedEvent(String id) { ITagEvent e = new TagEvent(this, id); // Guaranteed to return a non-null array 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] == ITagListener.class) { ((ITagListener) listeners[i + 1]).tagAdded(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] == IContextResultListener.class) { ((IContextResultListener) listeners[i + 1]).finished(e); } } } void fireResultArrived(final String providerName) { final IContextResultEvent e = new ContextResultEvent(this, providerName); // Guaranteed to return a non-null array final 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] == IContextResultListener.class) { ((IContextResultListener) listeners[i + 1]).resultArrived(e); } } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/tagging/TagManager.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/context/ContextSearchManager.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
Object[] listeners = listenerList.getListenerList();
1
Object[] listeners = listenerList.getListenerList();
2

3
		// Process the listeners last to first, notifying
2
		// Process the listeners last to first, notifying
4
		// those that are interested in this event
3
		// those that are interested in this event
5
		for (int i = listeners.length - 2; i >= 0; i -= 2) {
4
		for (int i = listeners.length - 2; i >= 0; i -= 2) {
6
			if (listeners[i] == ITagListener.class) {
5
			if (listeners[i] == IContextResultListener.class) {
7
				((ITagListener) listeners[i + 1]).tagChanged(e);
6
				((IContextResultListener) listeners[i + 1]).finished(e);
8
			}
7
			}
9
		}
8
		}
10
	}
9
	}
11
	/**
12
	 * @param id
13
	 */
14
	protected void fireTagAddedEvent(String id
15
) {
10
	void fireResultArrived(final String providerName) {
16
		ITagEvent e = new TagEvent(this, id);
11
		final IContextResultEvent e = new ContextResultEvent(this, providerName);
17
		// Guaranteed to return a non-null array
12
		// Guaranteed to return a non-null array
18
		Object[] listeners = listenerList.getListenerList();
13
		final Object[] listeners = listenerList.getListenerList();
19

20
		// Process the listeners last to first, notifying
14
		// Process the listeners last to first, notifying
21
		// those that are interested in this event
15
		// those that are interested in this event
22
		for (int i = listeners.length - 2; i >= 0; i -= 2) {
16
		for (int i = listeners.length - 2; i >= 0; i -= 2) {
23
			if (listeners[i] == ITagListener.class) {
17
			if (listeners[i] == IContextResultListener.class) {
24
				((ITagListener) listeners[i + 1]).tagAdded(e);
18
				((IContextResultListener) listeners[i + 1]).resultArrived(e);
25
			}
19
			}
26
		}
20
		}
27
	}
21
	}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0