if (status != null) event.setStatus(status); if (url != null) event.setUrl(url); if (description != null) event.setDescription(description);
if (summary != null) event.setSummary(summary); if (eventClass != null) event.setEventClass(eventClass); if (location != null) event.setLocation(location);
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 (status != null)
1
if (summary != null)
2
					event.setStatus(status);
2
					event.setSummary(summary);
3
				if (url != null)
3
				if (eventClass != null)
4
					event.setUrl(url);
4
					event.setEventClass(eventClass);
5
				if (description != null)
5
				if (location != null)
6
					event.setDescription(description);
6
					event.setLocation(location);
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 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)13.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    115
    if (status != null)
    115
    if (status != null)
    107
    if (summary != null)
    Differences
    Expression1Expression2Difference
    statussummaryVARIABLE_NAME_MISMATCH
    107
    if (summary != null)
    116
    event.setStatus(status);
    116
    event.setStatus(status);
    108
    event.setSummary(summary);
    Differences
    Expression1Expression2Difference
    statussummaryVARIABLE_NAME_MISMATCH
    setStatussetSummaryMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression event.setStatus(status) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression event.setSummary(summary) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression event.setStatus(status) is a void method call, and thus it cannot be parameterized
    Expression event.setSummary(summary) is a void method call, and thus it cannot be parameterized
    108
    event.setSummary(summary);
    117
    if (url != null)
    117
    if (url != null)
    109
    if (eventClass != null)
    Differences
    Expression1Expression2Difference
    urleventClassVARIABLE_NAME_MISMATCH
    java.net.URLjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.net.URL of variable url does not match with type java.lang.String of variable eventClass
    • Make classes java.net.URL and java.lang.String extend a common superclass
    109
    if (eventClass != null)
                                                                              
    110
    event.setEventClass(eventClass);
    Preondition Violations
    Unmatched statement event.setEventClass(eventClass); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    110
    event.setEventClass(eventClass);
    118
    event.setUrl(url);
    118
    event.setUrl(url);
    Preondition Violations
    Unmatched statement event.setUrl(url); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                  
    119
    if (description != null)
    119
    if (description != null)
    111
    if (location != null)
    Differences
    Expression1Expression2Difference
    descriptionlocationVARIABLE_NAME_MISMATCH
    111
    if (location != null)
    120
    event.setDescription(description);
    120
    event.setDescription(description);
    112
    event.setLocation(location);
    Differences
    Expression1Expression2Difference
    descriptionlocationVARIABLE_NAME_MISMATCH
    setDescriptionsetLocationMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression event.setDescription(description) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression event.setLocation(location) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression event.setDescription(description) 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);
    Precondition Violations (11)
    Row Violation
    1Expression event.setStatus(status) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression event.setSummary(summary) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression event.setStatus(status) is a void method call, and thus it cannot be parameterized
    4Expression event.setSummary(summary) is a void method call, and thus it cannot be parameterized
    5Type java.net.URL of variable url does not match with type java.lang.String of variable eventClass
    6Unmatched statement event.setEventClass(eventClass); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement event.setUrl(url); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Expression event.setDescription(description) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression event.setLocation(location) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression event.setDescription(description) is a void method call, and thus it cannot be parameterized
    11Expression event.setLocation(location) is a void method call, and thus it cannot be parameterized