IComponentInfoList list = new ComponentInfoList(); Iterator it = dataStorage.iterator(); while (it.hasNext()) { Document document = (Document) it.next(); IComponentInfo basicModel = null; try { basicModel = VCalendarModelFactory.unmarshall(document); } catch (SyntaxException e) { throw new StoreException(e); } catch (IllegalArgumentException e) { throw new StoreException(e); } if (basicModel.getType() == IComponent.TYPE.EVENT) { IEventInfo event = (IEventInfo) basicModel; list.add(event); } } return list;
ArrayList<String> result = new ArrayList<String>(); Iterator it = dataStorage.iterator(); while (it.hasNext()) { Document document = (Document) it.next(); IComponentInfo basicModel = null; try { basicModel = VCalendarModelFactory.unmarshall(document); } catch (SyntaxException e) { throw new StoreException(e); } catch (IllegalArgumentException e) { throw new StoreException(e); } if (basicModel.getType() == IComponent.TYPE.EVENT) { IEventInfo event = (IEventInfo) basicModel; if (event.getCalendar().equals(calendarId)) result.add(event.getId()); } } return result.iterator();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/store/LocalCalendarStore.java File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/store/LocalCalendarStore.java
Method name: IComponentInfoList getComponentInfoList() Method name: Iterator getIdIterator(String)
Number of AST nodes: 11 Number of AST nodes: 12
1
IComponentInfoList list = new ComponentInfoList();
1
ArrayList<String> result = new ArrayList<String>();
2
		Iterator it = dataStorage.iterator();
2
		Iterator it = dataStorage.iterator();
3
		while (it.hasNext()) {
3
		while (it.hasNext()) {
4
			Document document = (Document) it.next();
4
			Document document = (Document) it.next();
5
			IComponentInfo basicModel = null;
5
			IComponentInfo basicModel = null;
6
			try {
6
			try {
7
				basicModel = VCalendarModelFactory.unmarshall(document);
7
				basicModel = VCalendarModelFactory.unmarshall(document);
8
			} catch (SyntaxException e) {
8
			} catch (SyntaxException e) {
9
				throw new StoreException(e);
9
				throw new StoreException(e);
10
			} catch (IllegalArgumentException e) {
10
			} catch (IllegalArgumentException e) {
11
				throw new StoreException(e);
11
				throw new StoreException(e);
12
			}
12
			}
13
			if (basicModel.getType() == IComponent.TYPE.EVENT) {
13
			if (basicModel.getType() == IComponent.TYPE.EVENT) {
14
				IEventInfo event = (IEventInfo) basicModel;
14
				IEventInfo event = (IEventInfo) basicModel;
15
				lis
15
				if (event.getCalendar().equals(calendarId))
16
t.add(event);
16
					result.add(event.getId());
17
			}
17
			}
18
		}
18
		}
19
		return list;
19
		return result.iterator();
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.1
Clones locationClones are declared in the same class
Number of node comparisons2