double zMax = -1.e20; for (int k = 0; k < this.zValues.length; k++) { if (this.zValues[k] != null) { zMax = Math.max(zMax, this.zValues[k].doubleValue()); } } return zMax;
double zMin = 1.e20; for (int k = 0; k < this.zValues.length; k++) { if (this.zValues[k] != null) { zMin = Math.min(zMin, this.zValues[k].doubleValue()); } } return zMin;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/contour/DefaultContourDataset.java File path: /jfreechart-1.0.10/src/org/jfree/data/contour/DefaultContourDataset.java
Method name: double getMaxZValue() Method name: double getMinZValue()
Number of AST nodes: 5 Number of AST nodes: 5
1
double zMax = -1.e20;
1
double zMin = 1.e20;
2
        for (int k = 0; k < this.zValues.length; k++) {
2
        for (int k = 0; k < this.zValues.length; k++) {
3
            if (this.zValues[k] != null) {
3
            if (this.zValues[k] != null) {
4
                zMax = Math.max(zMax, this.zValues[k].doubleValue());
4
                zMin = Math.min(zMin, this.zValues[k].doubleValue());
5
            }
5
            }
6
        }
6
        }
7
        return zMax;
7
        return zMin;
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.3
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    double zMax = -1.e20;
    1
    double zMax = -1.e20;
    1
    double zMin = 1.e20;
    Differences
    Expression1Expression2Difference
    zMaxzMinVARIABLE_NAME_MISMATCH
    -1.e201.e20TYPE_COMPATIBLE_REPLACEMENT
    1
    double zMin = 1.e20;
    2
    for (int k = 0; k < this.zValues.length; k++)
    2
    for (int k = 0; k < this.zValues.length; k++)
    3
    if (this.zValues[k] != null)
    3
    if (this.zValues[k] != null)
    4
    zMax = Math.max(zMax, this.zValues[k].doubleValue());
    4
    zMax = Math.max(zMax, this.zValues[k].doubleValue());
    4
    zMin = Math.min(zMin, this.zValues[k].doubleValue());
    Differences
    Expression1Expression2Difference
    zMaxzMinVARIABLE_NAME_MISMATCH
    zMaxzMinVARIABLE_NAME_MISMATCH
    maxminMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression Math.max(zMax,this.zValues[k].doubleValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Math.min(zMin,this.zValues[k].doubleValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    zMin = Math.min(zMin, this.zValues[k].doubleValue());
    5
    return zMax;
    5
    return zMax;
    5
    return zMin;
    Differences
    Expression1Expression2Difference
    zMaxzMinVARIABLE_NAME_MISMATCH
    5
    return zMin;
    Precondition Violations (2)
    Row Violation
    1Expression Math.max(zMax,this.zValues[k].doubleValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression Math.min(zMin,this.zValues[k].doubleValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted