Range result = null; if (data != null) { float lowest = Float.POSITIVE_INFINITY; float highest = Float.NEGATIVE_INFINITY; for (int i = 0; i < data[0].length; i++) { float v = data[0][i]; if (v < lowest) { lowest = v; } if (v > highest) { highest = v; } } if (lowest <= highest) { result = new Range(lowest, highest); } } return result;
Range result = null; if (data != null) { float lowest = Float.POSITIVE_INFINITY; float highest = Float.NEGATIVE_INFINITY; for (int i = 0; i < data[0].length; i++) { float v = data[1][i]; if (v < lowest) { lowest = v; } if (v > highest) { highest = v; } } if (lowest <= highest) { result = new Range(lowest, highest); } } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java
Method name: Range calculateXDataRange(float[][]) Method name: Range calculateYDataRange(float[][])
Number of AST nodes: 13 Number of AST nodes: 13
1
Range result = null;
1
Range result = null;
2
        
2
        
3
        if (data != null) {
3
        if (data != null) {
4
            float lowest = Float.POSITIVE_INFINITY;
4
            float lowest = Float.POSITIVE_INFINITY;
5
            float highest = Float.NEGATIVE_INFINITY;
5
            float highest = Float.NEGATIVE_INFINITY;
6
            for (int i = 0; i < data[0].length; i++) {
6
            for (int i = 0; i < data[0].length; i++) {
7
                float v = data[0][i];
7
                float v = data[1][i];
8
                if (v < lowest) {
8
                if (v < lowest) {
9
                    lowest = v;
9
                    lowest = v;
10
                }
10
                }
11
                if (v > highest) {
11
                if (v > highest) {
12
                    highest = v;
12
                    highest = v;
13
                }
13
                }
14
            }
14
            }
15
            if (lowest <= highest) {
15
            if (lowest <= highest) {
16
                result = new Range(lowest, highest);
16
                result = new Range(lowest, highest);
17
            }
17
            }
18
        }
18
        }
19
        
20
        return result;
19
        return result;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are declared in the same class
Number of node comparisons34
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Range result = null;
    1
    Range result = null;
    2
    if (data != null)
    2
    if (data != null)
    3
    float lowest = Float.POSITIVE_INFINITY;
    3
    float lowest = Float.POSITIVE_INFINITY;
    4
    float highest = Float.NEGATIVE_INFINITY;
    4
    float highest = Float.NEGATIVE_INFINITY;
    5
    for (int i = 0; i < data[0].length; i++)
    5
    for (int i = 0; i < data[0].length; i++)
    6
    float v = data[0][i];
    6
    float v = data[0][i];
    6
    float v = data[1][i];
    Differences
    Expression1Expression2Difference
    01LITERAL_VALUE_MISMATCH
    6
    float v = data[1][i];
    7
    if (v < lowest)
    7
    if (v < lowest)
    8
    lowest = v;
    8
    lowest = v;
    9
    if (v > highest)
    9
    if (v > highest)
    10
    highest = v;
    10
    highest = v;
    11
    if (lowest <= highest)
    11
    if (lowest <= highest)
    12
    result = new Range(lowest, highest);
    12
    result = new Range(lowest, highest);
    13
    return result;
    13
    return result;
    Precondition Violations (0)
    Row Violation