if (summary != null) event.setSummary(summary); if (eventClass != null) event.setEventClass(eventClass); if (location != null) event.setLocation(location); if (priority != null) event.setPriority(priority);
if (priority != null) event.setPriority(priority); if (status != null) event.setStatus(status); if (url != null) event.setUrl(url); if (description != null) event.setDescription(description);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/parser/CalendarImporter.java File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/parser/CalendarImporter.java
Method name: Iterator importCalendar(ICalendarItem, File) Method name: Iterator importCalendar(ICalendarItem, File)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (summary != null)
1
if (priority != null)
2
					event.setSummary(summary);
2
					event.setPriority(priority);
3
				if (eventClass != null)
3
				if (status != null)
4
					event.setEventClass(eventClass);
4
					event.setStatus(status);
5
				if (location != null)
5
				if (url != null)
6
					event.setLocation(location);
6
					event.setUrl(url);
7
				if (priority != null)
7
				if (description != null)
8
					event.setPriority(priority);
8
					event.setDescription(description);
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.6
Clones locationClones are in the same method
Number of node comparisons49
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    107
    if (summary != null)
    107
    if (summary != null)
    113
    if (priority != null)
    Differences
    Expression1Expression2Difference
    summarypriorityVARIABLE_NAME_MISMATCH
    113
    if (priority != null)
    108
    event.setSummary(summary);
    108
    event.setSummary(summary);
    114
    event.setPriority(priority);
    Differences
    Expression1Expression2Difference
    setSummarysetPriorityMETHOD_INVOCATION_NAME_MISMATCH
    summarypriorityVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setSummary(summary) is a void method call, and thus it cannot be parameterized
    Expression event.setPriority(priority) is a void method call, and thus it cannot be parameterized
    114
    event.setPriority(priority);
    109
    if (eventClass != null)
    109
    if (eventClass != null)
    115
    if (status != null)
    Differences
    Expression1Expression2Difference
    eventClassstatusVARIABLE_NAME_MISMATCH
    115
    if (status != null)
    110
    event.setEventClass(eventClass);
    110
    event.setEventClass(eventClass);
    116
    event.setStatus(status);
    Differences
    Expression1Expression2Difference
    setEventClasssetStatusMETHOD_INVOCATION_NAME_MISMATCH
    eventClassstatusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setEventClass(eventClass) is a void method call, and thus it cannot be parameterized
    Expression event.setStatus(status) is a void method call, and thus it cannot be parameterized
    116
    event.setStatus(status);
    111
    if (location != null)
    111
    if (location != null)
    119
    if (description != null)
    Differences
    Expression1Expression2Difference
    locationdescriptionVARIABLE_NAME_MISMATCH
    119
    if (description != null)
    112
    event.setLocation(location);
    112
    event.setLocation(location);
    120
    event.setDescription(description);
    Differences
    Expression1Expression2Difference
    setLocationsetDescriptionMETHOD_INVOCATION_NAME_MISMATCH
    locationdescriptionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setLocation(location) is a void method call, and thus it cannot be parameterized
    Expression event.setDescription(description) is a void method call, and thus it cannot be parameterized
    120
    event.setDescription(description);
    113
    if (priority != null)
    113
    if (priority != null)
    117
    if (url != null)
    Differences
    Expression1Expression2Difference
    priorityurlVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.net.URLVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable priority does not match with type java.net.URL of variable url
    • Make classes java.lang.String and java.net.URL extend a common superclass
    117
    if (url != null)
    114
    event.setPriority(priority);
                                                                      
                                                  
    118
    event.setUrl(url);
    Precondition Violations (7)
    Row Violation
    1Expression event.setSummary(summary) is a void method call, and thus it cannot be parameterized
    2Expression event.setPriority(priority) is a void method call, and thus it cannot be parameterized
    3Expression event.setEventClass(eventClass) is a void method call, and thus it cannot be parameterized
    4Expression event.setStatus(status) is a void method call, and thus it cannot be parameterized
    5Expression event.setLocation(location) is a void method call, and thus it cannot be parameterized
    6Expression event.setDescription(description) is a void method call, and thus it cannot be parameterized
    7Type java.lang.String of variable priority does not match with type java.net.URL of variable url