while (high - low > 1) { double midV = dataset.getXValue(series, mid); if (midV >= xLow) { high = mid; } else { low = mid; } mid = (low + high) / 2; }
while (high - low > 1) { double midV = dataset.getXValue(series, mid); if (midV <= xHigh) { low = mid; } else { high = mid; } mid = (low + high + 1) / 2; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/RendererUtilities.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/RendererUtilities.java
Method name: int findLiveItemsLowerBound(XYDataset, int, double, double) Method name: int findLiveItemsUpperBound(XYDataset, int, double, double)
Number of AST nodes: 6 Number of AST nodes: 6
1
while (high - low > 1) {
1
while (high - low > 1) {
2
                double midV = dataset.getXValue(series, mid);
2
                double midV = dataset.getXValue(series, mid);
3
                if (midV &gt;= xLow) {
3
                if (midV &lt;= xHigh) {
4
                    high = mid;
4
                    low = mid;
5
                }
5
                }
6
                else {
6
                else {
7
                    low = mid;
7
                    high = mid;
8
                }
8
                }
9
                mid = (low + high) / 2;
9
                mid = (low + high + 1) / 2;
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.4
Clones locationClones are declared in the same class
Number of node comparisons19
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    while (high - low > 1)
    14
    while (high - low > 1)
    15
    double midV = dataset.getXValue(series, mid);
    15
    double midV = dataset.getXValue(series, mid);
    16
    if (midV >= xLow)
    16
    if (midV >= xLow)
    16
    if (midV <= xHigh)
    Differences
    Expression1Expression2Difference
    xLowxHighVARIABLE_NAME_MISMATCH
    >=<=OPERATOR_MISMATCH
    Preondition Violations
    Expression midV >= xLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression midV <= xHigh cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (midV <= xHigh)
    17
    high = mid;
    17
    high = mid;
    17
    low = mid;
    Differences
    Expression1Expression2Difference
    highlowVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression low cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17
    low = mid;
    else
    else
    18
    low = mid;
    18
    low = mid;
    18
    high = mid;
    Differences
    Expression1Expression2Difference
    lowhighVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression low cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18
    high = mid;
    19
    mid = (low + high) / 2;
    19
    mid = (low + high) / 2;
    19
    mid = (low + high + 1) / 2;
    Differences
    Expression1Expression2Difference
    low + highlow + high + 1INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression low + high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression low + high + 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19
    mid = (low + high + 1) / 2;
    Precondition Violations (8)
    Row Violation
    1Expression midV >= xLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression midV <= xHigh cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression low cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression low cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression low + high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression low + high + 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted