void addAll(List<IContactModelPartial> list) { Iterator<IContactModelPartial> it = list.iterator(); while (it.hasNext()) { addElement(it.next()); } } public void add(IContactModelPartial result) { addElement(result); } /** * ********************** filtering * ********************************************* */ /** * Associates filtering document listener to text component. */ public void installJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().addDocumentListener(model); } } /** * Disassociates filtering document listener from text component. */ public void uninstallJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().removeDocumentListener(model); } } /** * Doesn't let model change to non-filtering variety */ public void setModel(ListModel model) { if (!(model instanceof FilteringModel)) { throw new IllegalArgumentException(); } else { super.setModel(model); } } /** * Adds item to model of list */ public void addElement(IContactModelPartial element) { ((FilteringModel) getModel()).addElement(element);
void addAll(List<IEventInfo> list) { Iterator<IEventInfo> it = list.iterator(); while (it.hasNext()) { addElement(it.next()); } } public void add(IEventInfo result) { addElement(result); } /** * ********************** filtering * ********************************************* */ /** * Associates filtering document listener to text component. */ public void installJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().addDocumentListener(model); } } /** * Disassociates filtering document listener from text component. */ public void uninstallJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().removeDocumentListener(model); } } /** * Doesn't let model change to non-filtering variety */ public void setModel(ListModel model) { if (!(model instanceof FilteringModel)) { throw new IllegalArgumentException(); } else { super.setModel(model); } } /** * Adds item to model of list */ public void addElement(IEventInfo element) { ((FilteringModel) getModel()).addElement(element);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/ContactList.java File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/box/CalendarList.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void addAll(List<IContactModelPartial> list) {
1
void addAll(List<IEventInfo> list) {
2
		Iterator<IContactModelPartial> it = list.iterator();
2
		Iterator<IEventInfo> it = list.iterator();
3
		while (it.hasNext()) {
3
		while (it.hasNext()) {
4
			addElement(it.next());
4
			addElement(it.next());
5
		}
5
		}
6
	}
6
	}
7
	public void add(IContactModelPartial result) {
7
	public void add(IEventInfo result) {
8
		addElement(result);
8
		addElement(result);
9
	}
9
	}
10
	/**
10
	/**
11
	 * ********************** filtering
11
	 * ********************** filtering
12
	 * *********************************************
12
	 * *********************************************
13
	 */
13
	 */
14
	/**
14
	/**
15
	 * Associates filtering document listener to text component.
15
	 * Associates filtering document listener to text component.
16
	 */
16
	 */
17
	public void installJTextField(JTextField input) {
17
	public void installJTextField(JTextField input) {
18
		if (input != null) {
18
		if (input != null) {
19
			FilteringModel model = (FilteringModel) getModel();
19
			FilteringModel model = (FilteringModel) getModel();
20
			input.getDocument().addDocumentListener(model);
20
			input.getDocument().addDocumentListener(model);
21
		}
21
		}
22
	}
22
	}
23
	/**
23
	/**
24
	 * Disassociates filtering document listener from text component.
24
	 * Disassociates filtering document listener from text component.
25
	 */
25
	 */
26
	public void uninstallJTextField(JTextField input) {
26
	public void uninstallJTextField(JTextField input) {
27
		if (input != null) {
27
		if (input != null) {
28
			FilteringModel model = (FilteringModel) getModel();
28
			FilteringModel model = (FilteringModel) getModel();
29
			input.getDocument().removeDocumentListener(model);
29
			input.getDocument().removeDocumentListener(model);
30
		}
30
		}
31
	}
31
	}
32
	/**
32
	/**
33
	 * Doesn't let model change to non-filtering variety
33
	 * Doesn't let model change to non-filtering variety
34
	 */
34
	 */
35
	public void setModel(ListModel model) {
35
	public void setModel(ListModel model) {
36
		if (!(model instanceof FilteringModel)) {
36
		if (!(model instanceof FilteringModel)) {
37
			throw new IllegalArgumentException();
37
			throw new IllegalArgumentException();
38
		} else {
38
		} else {
39
			super.setModel(model);
39
			super.setModel(model);
40
		}
40
		}
41
	}
41
	}
42
	/**
42
	/**
43
	 * Adds item to model of list
43
	 * Adds item to model of list
44
	 */
44
	 */
45
	public void addElement(IContactModelPartial element) {
45
	public void addElement(IEventInfo element) {
46
		((FilteringModel) getModel()).addElement(element);
46
		((FilteringModel) getModel()).addElement(element);
47
	
47
	
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