String s = get(ICALENDAR.DTSTART);
Calendar c;
try {
c = DateParser.createCalendarFromString(s);
return c;
} catch (IllegalArgumentException e) {
LOG.severe("date parsing exception");
e.printStackTrace();
}
return Calendar.getInstance();
String s = get(ICALENDAR.DTEND);
Calendar c;
try {
c = DateParser.createCalendarFromString(s);
return c;
} catch (IllegalArgumentException e) {
LOG.severe("date parsing exception");
e.printStackTrace();
}
return Calendar.getInstance();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/parser/XCSDocumentParser.java
|
|
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/parser/XCSDocumentParser.java
|
Method name: Calendar getDTStart()
|
|
Method name: Calendar getDTEnd()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | String s = get(ICALENDAR.DTSTART);↵ | | 1 | String s = get(ICALENDAR.DTEND);↵
|
2 | Calendar c;↵ | | 2 | Calendar c;↵
|
3 | try {↵ | | 3 | try {↵
|
4 | c = DateParser.createCalendarFromString(s);↵ | | 4 | c = DateParser.createCalendarFromString(s);↵
|
5 | return c;↵ | | 5 | return c;↵
|
6 | } catch (IllegalArgumentException e) {↵ | | 6 | } catch (IllegalArgumentException e) {↵
|
7 | LOG.severe("date parsing exception");↵ | | 7 | LOG.severe("date parsing exception");↵
|
|
8 | e.printStackTrace();↵ | | 8 | e.printStackTrace();↵
|
9 | }↵ | | 9 | }↵
|
|
10 | return Calendar.getInstance(); | | 10 | return Calendar.getInstance();
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
-
{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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | String s = get(ICALENDAR.DTSTART); | | 1 | String s = get(ICALENDAR.DTEND); |
2 | Calendar c; | | 2 | Calendar c; |
3 | try | | 3 | try |
4 | c = DateParser.createCalendarFromString(s); | | 4 | c = DateParser.createCalendarFromString(s); |
5 | | | 5 | |
6 | return Calendar.getInstance(); | | 6 | return Calendar.getInstance(); |
Precondition Violations (0)
Row |
Violation |