IEvent event = (IEvent) c; Calendar startDate = event.getDtStart(); Calendar endDate = event.getDtEnd(); IDateRange dr = new DateRange(startDate, endDate);
ITodo todo = (ITodo) c; Calendar startDate = todo.getDtStart(); Calendar endDate = todo.getDue(); IDateRange dr = new DateRange(startDate, endDate);
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 findByDateRange(IDateRange) Method name: Iterator findByDateRange(IDateRange)
Number of AST nodes: 4 Number of AST nodes: 4
1
IEvent event = (IEvent) c;
1
ITodo todo = (ITodo) c;
2
				Calendar startDate = event.getDtStart();
2
				Calendar startDate = todo.getDtStart();
3
				Calendar endDate = event.getDtEnd();
3
				Calendar endDate = todo.getDue();
4
				IDateRange dr = new DateRange(startDate, endDate);
4
				IDateRange dr = new DateRange(startDate, endDate);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in the same method
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    IEvent event = (IEvent)c;
    7
    IEvent event = (IEvent)c;
    Preondition Violations
    Unmatched statement IEvent event=(IEvent)c; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                        
                                                    
    14
    ITodo todo = (ITodo)c;
    Preondition Violations
    Unmatched statement ITodo todo=(ITodo)c; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14
    ITodo todo = (ITodo)c;
    8
    Calendar startDate = event.getDtStart();
    8
    Calendar startDate = event.getDtStart();
    15
    Calendar startDate = todo.getDtStart();
    Differences
    Expression1Expression2Difference
    eventtodoVARIABLE_NAME_MISMATCH
    org.columba.calendar.model.api.IEventorg.columba.calendar.model.api.ITodoVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.calendar.model.api.IEvent of variable event does not match with type org.columba.calendar.model.api.ITodo of variable todo
    • Make classes org.columba.calendar.model.api.IEvent and org.columba.calendar.model.api.ITodo extend a common superclass
    15
    Calendar startDate = todo.getDtStart();
    9
    Calendar endDate = event.getDtEnd();
    9
    Calendar endDate = event.getDtEnd();
    Preondition Violations
    Unmatched statement Calendar endDate=event.getDtEnd(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
                                                                          
    16
    Calendar endDate = todo.getDue();
    Preondition Violations
    Unmatched statement Calendar endDate=todo.getDue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16
    Calendar endDate = todo.getDue();
    10
    IDateRange dr = new DateRange(startDate, endDate);
    17
    IDateRange dr = new DateRange(startDate, endDate);
    Precondition Violations (5)
    Row Violation
    1Unmatched statement IEvent event=(IEvent)c; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ITodo todo=(ITodo)c; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.columba.calendar.model.api.IEvent of variable event does not match with type org.columba.calendar.model.api.ITodo of variable todo
    4Unmatched statement Calendar endDate=event.getDtEnd(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement Calendar endDate=todo.getDue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted