if (this.maxStartIndex >= 0) { long maxStart = getDataItem(this.maxStartIndex).getPeriod() .getStart().getTime(); if (start > maxStart) { this.maxStartIndex = index; } } else { this.maxStartIndex = index; }
if (this.minEndIndex >= 0) { long minEnd = getDataItem(this.minEndIndex).getPeriod().getEnd() .getTime(); if (end < minEnd) { this.minEndIndex = index; } } else { this.minEndIndex = index; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimePeriodValues.java File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimePeriodValues.java
Method name: void updateBounds(TimePeriod, int) Method name: void updateBounds(TimePeriod, int)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (this.maxStartIndex >= 0) {
1
if (this.minEndIndex >= 0) {
2
            long maxStart = getDataItem(this.maxStartIndex).getPeriod()
2
            long minEnd = getDataItem(this.minEndIndex).getPeriod().getEnd()
3
                .getStart().getTime();
3
                .getTime();
4
            if (start &gt; maxStart) {
4
            if (end &lt; minEnd) {
5
                this.maxStartIndex = index;           
5
                this.minEndIndex = index;           
6
            }
6
            }
7
        }
7
        }
8
        else {
8
        else {
9
            this.maxStartIndex = index;
9
            this.minEndIndex = index;
10
        }
10
        }
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.2
Clones locationClones are in the same method
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    if (this.maxStartIndex >= 0)
    9
    if (this.maxStartIndex >= 0)
    28
    if (this.minEndIndex >= 0)
    Differences
    Expression1Expression2Difference
    maxStartIndexminEndIndexVARIABLE_NAME_MISMATCH
    28
    if (this.minEndIndex >= 0)
    10
    long maxStart = getDataItem(this.maxStartIndex).getPeriod().getStart().getTime();
    10
    long maxStart = getDataItem(this.maxStartIndex).getPeriod().getStart().getTime();
    29
    long minEnd = getDataItem(this.minEndIndex).getPeriod().getEnd().getTime();
    Differences
    Expression1Expression2Difference
    maxStartminEndVARIABLE_NAME_MISMATCH
    getStartgetEndMETHOD_INVOCATION_NAME_MISMATCH
    maxStartIndexminEndIndexVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getDataItem(this.maxStartIndex).getPeriod().getStart() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getDataItem(this.minEndIndex).getPeriod().getEnd() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29
    long minEnd = getDataItem(this.minEndIndex).getPeriod().getEnd().getTime();
    11
    if (start > maxStart)
    11
    if (start > maxStart)
    30
    if (end < minEnd)
    Differences
    Expression1Expression2Difference
    startendVARIABLE_NAME_MISMATCH
    maxStartminEndVARIABLE_NAME_MISMATCH
    ><OPERATOR_MISMATCH
    Preondition Violations
    Expression start > maxStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression end < minEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30
    if (end < minEnd)
    12
    this.maxStartIndex = index;
    12
    this.maxStartIndex = index;
    31
    this.minEndIndex = index;
    Differences
    Expression1Expression2Difference
    maxStartIndexminEndIndexVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.maxStartIndex is a field being modified, and thus it cannot be parameterized
    Expression this.minEndIndex is a field being modified, and thus it cannot be parameterized
    31
    this.minEndIndex = index;
    else
    else
    13
    this.maxStartIndex = index;
    13
    this.maxStartIndex = index;
    32
    this.minEndIndex = index;
    Differences
    Expression1Expression2Difference
    maxStartIndexminEndIndexVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.maxStartIndex is a field being modified, and thus it cannot be parameterized
    Expression this.minEndIndex is a field being modified, and thus it cannot be parameterized
    32
    this.minEndIndex = index;
    Precondition Violations (8)
    Row Violation
    1Expression getDataItem(this.maxStartIndex).getPeriod().getStart() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getDataItem(this.minEndIndex).getPeriod().getEnd() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression start > maxStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression end < minEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.maxStartIndex is a field being modified, and thus it cannot be parameterized
    6Expression this.minEndIndex is a field being modified, and thus it cannot be parameterized
    7Expression this.maxStartIndex is a field being modified, and thus it cannot be parameterized
    8Expression this.minEndIndex is a field being modified, and thus it cannot be parameterized