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; if (event.getCalendar().equals(calendarId)) { list.add(event); } } } return list;
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;
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(String) Method name: IComponentInfoList getComponentInfoList()
Number of AST nodes: 12 Number of AST nodes: 11
1
IComponentInfoList list = new ComponentInfoList();
1
IComponentInfoList list = new ComponentInfoList();
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
				if (event.getCalendar().equals(calendarId)) {
15
				
16
					list.add(event);
16
list.add(event);
17
				}
17
			
18
			}
18
}
19
		}
19
		}
20
		return list;
20
		return list;
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.2
Clones locationClones are declared in the same class
Number of node comparisons13