if (c.getType().equals(IComponent.TYPE.TODO)) { ITodo todo = (ITodo) c; Calendar sd = todo.getDtStart(); Calendar endDate = todo.getDue(); IDateRange dr = new DateRange(startDate, endDate); if (startDate.equals(sd)) result.add(id); } else throw new IllegalArgumentException( "unsupported component type " + c.getType());
Element menuElement = (Element) it.next(); if (menuElement.getName().equals(MenuXMLDecoder.MENU)) { String menuId = menuElement .getAttributeValue(MenuXMLDecoder.ID); String menuName = mediator.getString("menu", "mainframe", menuId); ExtendableMenu menu = new ExtendableMenu(menuId, menuName); parseMenu(menu, menuElement); menuBar.add(menu); }
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/core/src/main/java/org/columba/core/gui/menu/MenuXMLDecoder.java
Method name: Iterator findByStartDate(Calendar) Method name: ExtendableMenuBar createMenuBar(InputStream)
Number of AST nodes: 8 Number of AST nodes: 7
1
if (c
1
Element menuElement = (Element) it.next();
2
.getType().equals(IComponent.TYPE.TODO)) {
2
			if (menuElement.getName().equals(MenuXMLDecoder.MENU)) {
3
				ITodo todo = (ITodo) c;
3
				
4
				Calendar sd = todo.getDtStart(
4
String menuId = menuElement
5
);
5
						.getAttributeValue(MenuXMLDecoder.ID);
6
				Calendar endDate = todo.getDue(
6
				String menuName = mediator.getString("menu", "mainframe",
7
);
7
						menuId);
8
				IDateRange dr = new DateRange(startDate, endDate);
8
				ExtendableMenu menu = new ExtendableMenu(menuId, menuName);
9
				if (startDate.equals(sd))
9
				
10
					result.add(id);
11
			} else
12
				throw new IllegalArgumentException(
13
						"unsupported component type " + c.getType());
10
parseMenu(menu, menuElement);
11
				menuBar.add(menu);
12
			}
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 in different classes
Number of node comparisons1