if (this.minStartIndex >= 0) { long minStart = getDataItem(this.minStartIndex).getPeriod() .getStart().getTime(); if (start < minStart) { this.minStartIndex = index; } } else { this.minStartIndex = index; }
if (this.maxEndIndex >= 0) { long maxEnd = getDataItem(this.maxEndIndex).getPeriod().getEnd() .getTime(); if (end > maxEnd) { this.maxEndIndex = index; } } else { this.maxEndIndex = 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.minStartIndex >= 0) {
1
if (this.maxEndIndex >= 0) {
2
            long minStart = getDataItem(this.minStartIndex).getPeriod()
2
            long maxEnd = getDataItem(this.maxEndIndex).getPeriod().getEnd()
3
                .getStart().getTime();
3
                .getTime();
4
            if (start &lt; minStart) {
4
            if (end &gt; maxEnd) {
5
                this.minStartIndex = index;           
5
                this.maxEndIndex = index;           
6
            }
6
            }
7
        }
7
        }
8
        else {
8
        else {
9
            this.minStartIndex = index;
9
            this.maxEndIndex = 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)4.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (this.minStartIndex >= 0)
    4
    if (this.minStartIndex >= 0)
    33
    if (this.maxEndIndex >= 0)
    Differences
    Expression1Expression2Difference
    minStartIndexmaxEndIndexVARIABLE_NAME_MISMATCH
    33
    if (this.maxEndIndex >= 0)
    5
    long minStart = getDataItem(this.minStartIndex).getPeriod().getStart().getTime();
    5
    long minStart = getDataItem(this.minStartIndex).getPeriod().getStart().getTime();
    34
    long maxEnd = getDataItem(this.maxEndIndex).getPeriod().getEnd().getTime();
    Differences
    Expression1Expression2Difference
    minStartmaxEndVARIABLE_NAME_MISMATCH
    getStartgetEndMETHOD_INVOCATION_NAME_MISMATCH
    minStartIndexmaxEndIndexVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getDataItem(this.minStartIndex).getPeriod().getStart() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getDataItem(this.maxEndIndex).getPeriod().getEnd() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    34
    long maxEnd = getDataItem(this.maxEndIndex).getPeriod().getEnd().getTime();
    6
    if (start < minStart)
    6
    if (start < minStart)
    35
    if (end > maxEnd)
    Differences
    Expression1Expression2Difference
    startendVARIABLE_NAME_MISMATCH
    minStartmaxEndVARIABLE_NAME_MISMATCH
    <>OPERATOR_MISMATCH
    Preondition Violations
    Expression start < minStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression end > maxEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35
    if (end > maxEnd)
    7
    this.minStartIndex = index;
    7
    this.minStartIndex = index;
    36
    this.maxEndIndex = index;
    Differences
    Expression1Expression2Difference
    minStartIndexmaxEndIndexVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.minStartIndex is a field being modified, and thus it cannot be parameterized
    Expression this.maxEndIndex is a field being modified, and thus it cannot be parameterized
    36
    this.maxEndIndex = index;
    else
    else
    8
    this.minStartIndex = index;
    8
    this.minStartIndex = index;
    37
    this.maxEndIndex = index;
    Differences
    Expression1Expression2Difference
    minStartIndexmaxEndIndexVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.minStartIndex is a field being modified, and thus it cannot be parameterized
    Expression this.maxEndIndex is a field being modified, and thus it cannot be parameterized
    37
    this.maxEndIndex = index;
    Precondition Violations (8)
    Row Violation
    1Expression getDataItem(this.minStartIndex).getPeriod().getStart() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getDataItem(this.maxEndIndex).getPeriod().getEnd() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression start < minStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression end > maxEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.minStartIndex is a field being modified, and thus it cannot be parameterized
    6Expression this.maxEndIndex is a field being modified, and thus it cannot be parameterized
    7Expression this.minStartIndex is a field being modified, and thus it cannot be parameterized
    8Expression this.maxEndIndex is a field being modified, and thus it cannot be parameterized