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; result.add(event.getId()); } }
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()); }
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: Iterator getIdIterator() Method name: Iterator getIdIterator(String)
Number of AST nodes: 8 Number of AST nodes: 8
1
while (it.hasNext()) {
2
			Document document = (Document) it.next();
1
Document document = (Document) it.next();
3
			IComponentInfo basicModel = null;
2
			IComponentInfo basicModel = null;
4
			try {
3
			try {
5
				basicModel = VCalendarModelFactory.unmarshall(document);
4
				basicModel = VCalendarModelFactory.unmarshall(document);
6
			} catch (SyntaxException e) {
5
			} catch (SyntaxException e) {
7
				throw new StoreException(e);
6
				throw new StoreException(e);
8
			} catch (IllegalArgumentException e) {
7
			} catch (IllegalArgumentException e) {
9
				throw new StoreException(e);
8
				throw new StoreException(e);
10
			}
9
			}
11
			if (basicModel.getType() == IComponent.TYPE.EVENT) {
10
			if (basicModel.getType() == IComponent.TYPE.EVENT) {
12
				IEventInfo event = (IEventInfo) basicModel;
11
				IEventInfo event = (IEventInfo) basicModel;
13
				
12
				if (event.getCalendar().equals(calendarId))
14
result.add(event.getId());
13
					result.add(event.getId());
15
			}
14
			}
16
		}
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