if (summary != null) event.setSummary(summary); if (eventClass != null) event.setEventClass(eventClass); if (location != null) event.setLocation(location);
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: 6 Number of AST nodes: 6
1
if (summary != null)
1
if (status != null)
2
					event.setSummary(summary);
2
					event.setStatus(status);
3
				if (eventClass != null)
3
				if (url != null)
4
					event.setEventClass(eventClass);
4
					event.setUrl(url);
5
				if (location != null)
5
				if (description != null)
6
					event.setLocation(location);
6
					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.5
Clones locationClones are in the same method
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    107
    if (summary != null)
    107
    if (summary != null)
    115
    if (status != null)
    Differences
    Expression1Expression2Difference
    summarystatusVARIABLE_NAME_MISMATCH
    115
    if (status != null)
    108
    event.setSummary(summary);
    108
    event.setSummary(summary);
    116
    event.setStatus(status);
    Differences
    Expression1Expression2Difference
    setSummarysetStatusMETHOD_INVOCATION_NAME_MISMATCH
    summarystatusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setSummary(summary) 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);
    109
    if (eventClass != null)
    109
    if (eventClass != null)
    119
    if (description != null)
    Differences
    Expression1Expression2Difference
    eventClassdescriptionVARIABLE_NAME_MISMATCH
    119
    if (description != null)
    110
    event.setEventClass(eventClass);
    110
    event.setEventClass(eventClass);
    120
    event.setDescription(description);
    Differences
    Expression1Expression2Difference
    setEventClasssetDescriptionMETHOD_INVOCATION_NAME_MISMATCH
    eventClassdescriptionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setEventClass(eventClass) 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);
    111
    if (location != null)
    111
    if (location != null)
    117
    if (url != null)
    Differences
    Expression1Expression2Difference
    locationurlVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.net.URLVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable location 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)
    112
    event.setLocation(location);
                                                                      
                                                  
    118
    event.setUrl(url);
    Precondition Violations (5)
    Row Violation
    1Expression event.setSummary(summary) is a void method call, and thus it cannot be parameterized
    2Expression event.setStatus(status) 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.setDescription(description) is a void method call, and thus it cannot be parameterized
    5Type java.lang.String of variable location does not match with type java.net.URL of variable url