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 (status != null) event.setStatus(status);
if (location != null) event.setLocation(location); 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: 10 Number of AST nodes: 10
1
if (summary != null)
2
					event.setSummary(summary);
3
				if (eventClass != null)
4
					event.setEventClass(eventClass);
5
				if (location != null)
1
if (location != null)
6
					event.setLocation(location);
2
					event.setLocation(location);
7
				if (priority != null)
3
				if (priority != null)
8
					event.setPriority(priority);
4
					event.setPriority(priority);
9
				if (status != null)
5
				if (status != null)
10
					event.setStatus(status);
6
					event.setStatus(status);
7
				if (url != null)
8
					event.setUrl(url);
9
				if (description != null)
10
					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.9
Clones locationClones are in the same method
Number of node comparisons73
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    107
    if (summary != null)
    107
    if (summary != null)
    111
    if (location != null)
    Differences
    Expression1Expression2Difference
    summarylocationVARIABLE_NAME_MISMATCH
    111
    if (location != null)
    108
    event.setSummary(summary);
    108
    event.setSummary(summary);
    112
    event.setLocation(location);
    Differences
    Expression1Expression2Difference
    setSummarysetLocationMETHOD_INVOCATION_NAME_MISMATCH
    summarylocationVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setSummary(summary) is a void method call, and thus it cannot be parameterized
    Expression event.setLocation(location) is a void method call, and thus it cannot be parameterized
    112
    event.setLocation(location);
    109
    if (eventClass != null)
    109
    if (eventClass != null)
    113
    if (priority != null)
    Differences
    Expression1Expression2Difference
    eventClasspriorityVARIABLE_NAME_MISMATCH
    113
    if (priority != null)
    110
    event.setEventClass(eventClass);
    110
    event.setEventClass(eventClass);
    114
    event.setPriority(priority);
    Differences
    Expression1Expression2Difference
    setEventClasssetPriorityMETHOD_INVOCATION_NAME_MISMATCH
    eventClasspriorityVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setEventClass(eventClass) 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);
    111
    if (location != null)
    111
    if (location != null)
    115
    if (status != null)
    Differences
    Expression1Expression2Difference
    locationstatusVARIABLE_NAME_MISMATCH
    115
    if (status != null)
    112
    event.setLocation(location);
    112
    event.setLocation(location);
    116
    event.setStatus(status);
    Differences
    Expression1Expression2Difference
    setLocationsetStatusMETHOD_INVOCATION_NAME_MISMATCH
    locationstatusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setLocation(location) 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);
    113
    if (priority != null)
    113
    if (priority != null)
    119
    if (description != null)
    Differences
    Expression1Expression2Difference
    prioritydescriptionVARIABLE_NAME_MISMATCH
    119
    if (description != null)
    114
    event.setPriority(priority);
    114
    event.setPriority(priority);
    120
    event.setDescription(description);
    Differences
    Expression1Expression2Difference
    setPrioritysetDescriptionMETHOD_INVOCATION_NAME_MISMATCH
    prioritydescriptionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression event.setPriority(priority) 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);
    115
    if (status != null)
    115
    if (status != null)
    117
    if (url != null)
    Differences
    Expression1Expression2Difference
    statusurlVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.net.URLVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable status 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)
    116
    event.setStatus(status);
                                                              
                                                  
    118
    event.setUrl(url);
    Precondition Violations (9)
    Row Violation
    1Expression event.setSummary(summary) is a void method call, and thus it cannot be parameterized
    2Expression event.setLocation(location) 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.setPriority(priority) 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.setStatus(status) is a void method call, and thus it cannot be parameterized
    7Expression event.setPriority(priority) is a void method call, and thus it cannot be parameterized
    8Expression event.setDescription(description) is a void method call, and thus it cannot be parameterized
    9Type java.lang.String of variable status does not match with type java.net.URL of variable url