File example1 = new File("calendar/src/test/resources/SunbirdEvents.ics");
CalendarItem calendarItem = new CalendarItem("example", ICalendarItem.TYPE.LOCAL, "example", null);
CalendarImporter importer = new CalendarImporter();
Iterator<IEventInfo> i = null;
try {
i = importer.importCalendar(calendarItem, example1);
} catch (Exception e) {
e.printStackTrace();
fail("Got following exception:" + e.getMessage());
}
File example1 = new File("calendar/src/test/resources/SunbirdRecurrendEvents.ics");
CalendarItem calendarItem = new CalendarItem("example", ICalendarItem.TYPE.LOCAL, "example", null);
CalendarImporter importer = new CalendarImporter();
Iterator<IEventInfo> i = null;
try {
i = importer.importCalendar(calendarItem, example1);
} catch (Exception e) {
e.printStackTrace();
fail("Got following exception:" + e.getMessage());
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/test/java/org/columba/calendar/parser/CalendarImporterTest.java
|
|
File path: /columba-1.4-src/calendar/src/test/java/org/columba/calendar/parser/CalendarImporterTest.java
|
Method name: void testImportCalendar()
|
|
Method name: void testImportCalendarRecurrence()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | File example1 = new File("calendar/src/test/resources/SunbirdEvents.ics");↵ | | 1 | File example1 = new File("calendar/src/test/resources/SunbirdRecurrendEvents.ics");↵
|
2 | CalendarItem calendarItem = new CalendarItem("example", ICalendarItem.TYPE.LOCAL, "example", null);↵ | | 2 | CalendarItem calendarItem = new CalendarItem("example", ICalendarItem.TYPE.LOCAL, "example", null);↵
|
3 | CalendarImporter importer = new CalendarImporter();↵ | | 3 | CalendarImporter importer = new CalendarImporter();↵
|
4 | Iterator<IEventInfo> i = null;↵ | | 4 | Iterator<IEventInfo> i = null;↵
|
5 | try {↵ | | 5 | try {↵
|
6 | i = importer.importCalendar(calendarItem, example1);↵ | | 6 | i = importer.importCalendar(calendarItem, example1);↵
|
7 | } catch (Exception e) {↵ | | 7 | } catch (Exception e) {↵
|
8 | e.printStackTrace();↵ | | 8 | e.printStackTrace();↵
|
9 | fail("Got following exception:" + e.getMessage());↵ | | 9 | fail("Got following exception:" + e.getMessage());↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 12 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | File example1 = new File("calendar/src/test/resources/SunbirdEvents.ics"); | | 1 | File example1 = new File("calendar/src/test/resources/SunbirdRecurrendEvents.ics"); |
2 | CalendarItem calendarItem = new CalendarItem("example", ICalendarItem.TYPE.LOCAL, "example", null); | | 2 | CalendarItem calendarItem = new CalendarItem("example", ICalendarItem.TYPE.LOCAL, "example", null); |
3 | CalendarImporter importer = new CalendarImporter(); | | 3 | CalendarImporter importer = new CalendarImporter(); |
4 | Iterator<IEventInfo> i = null; | | 4 | Iterator<IEventInfo> i = null; |
5 | try | | 5 | try |
6 | i = importer.importCalendar(calendarItem, example1); | | 6 | i = importer.importCalendar(calendarItem, example1); |
Precondition Violations (0)
Row |
Violation |