Object returnValue; if (index < filteredList.size()) { returnValue = filteredList.get(index); } else { returnValue = null; } return returnValue;
Object returnValue; if (index < filteredList.size()) { returnValue = filteredList.get(index); } else { returnValue = null; } return returnValue;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/box/FilteringModel.java File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/FilteringModel.java
Method name: Object getElementAt(int) Method name: Object getElementAt(int)
Number of AST nodes: 5 Number of AST nodes: 5
1
Object returnValue;
1
Object returnValue;
2
		if (index < filteredList.size()) {
2
		if (index < filteredList.size()) {
3
			returnValue = filteredList.get(index);
3
			returnValue = filteredList.get(index);
4
		} else {
4
		} else {
5
			returnValue = null;
5
			returnValue = null;
6
		}
6
		}
7
		return returnValue;
7
		return returnValue;
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Object returnValue;
    1
    Object returnValue;
    2
    if (index < filteredList.size())
    2
    if (index < filteredList.size())
    2
    if (index < filteredList.size())
    Differences
    Expression1Expression2Difference
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List<org.columba.calendar.model.api.IEventInfo> of variable filteredList does not match with type java.util.List<org.columba.addressbook.model.IContactModelPartial> of variable filteredList
    • Make classes java.util.List and java.util.List extend a common superclass
    2
    if (index < filteredList.size())
                                                                                  
    3
    returnValue = filteredList.get(index);
    Preondition Violations
    Unmatched statement returnValue=filteredList.get(index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    returnValue = filteredList.get(index);
    3
    returnValue = filteredList.get(index);
    3
    returnValue = filteredList.get(index);
    Preondition Violations
    Unmatched statement returnValue=filteredList.get(index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
    else
    else
    4
    returnValue = null;
    4
    returnValue = null;
    5
    return returnValue;
    5
    return returnValue;
    Precondition Violations (3)
    Row Violation
    1Type java.util.List<org.columba.calendar.model.api.IEventInfo> of variable filteredList does not match with type java.util.List<org.columba.addressbook.model.IContactModelPartial> of variable filteredList
    2Unmatched statement returnValue=filteredList.get(index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement returnValue=filteredList.get(index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted