if (value == vp) { return this.boundMappedToLastCycle ? jmin : jmax; } else if (value > vp) { return jmax - (value - vp) * (jmax - jmin) / this.period; } else { return jmin + (vp - value) * (jmax - jmin) / this.period; }
if (value == vp) { return this.boundMappedToLastCycle ? jmax : jmin; } else if (value >= vp) { return jmin + (value - vp) * (jmax - jmin) / this.period; } else { return jmax - (vp - value) * (jmax - jmin) / this.period; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java
Method name: double valueToJava2D(double, Rectangle2D, RectangleEdge) Method name: double valueToJava2D(double, Rectangle2D, RectangleEdge)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (value == vp) {
1
if (value == vp) {
2
                return this.boundMappedToLastCycle ? jmin : jmax; 
2
                return this.boundMappedToLastCycle ? jmax : jmin; 
3
            }
3
            }
4
            else if (value > vp) {
4
            else if (value >= vp) {
5
                return jmax - (value - vp) * (jmax - jmin) / this.period;
5
                return jmin + (value - vp) * (jmax - jmin) / this.period;
6
            } 
6
            } 
7
            else {
7
            else {
8
                return jmin + (vp - value) * (jmax - jmin) / this.period;
8
                return jmax - (vp - value) * (jmax - jmin) / this.period;
9
            }
9
            }
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 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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    if (value == vp)
    21
    if (value == vp)
    17
    return this.boundMappedToLastCycle ? jmin : jmax;
    17
    return this.boundMappedToLastCycle ? jmin : jmax;
    22
    return this.boundMappedToLastCycle ? jmax : jmin;
    Differences
    Expression1Expression2Difference
    jminjmaxVARIABLE_NAME_MISMATCH
    jmaxjminVARIABLE_NAME_MISMATCH
    22
    return this.boundMappedToLastCycle ? jmax : jmin;
    18
    else if (value > vp)
    18
    else if (value > vp)
    23
    else if (value >= vp)
    Differences
    Expression1Expression2Difference
    >>=OPERATOR_MISMATCH
    Preondition Violations
    Expression value > vp cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression value >= vp cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23
    else if (value >= vp)
    19
    return jmax - (value - vp) * (jmax - jmin) / this.period;
    19
    return jmax - (value - vp) * (jmax - jmin) / this.period;
    24
    return jmin + (value - vp) * (jmax - jmin) / this.period;
    Differences
    Expression1Expression2Difference
    jmaxjminVARIABLE_NAME_MISMATCH
    -+OPERATOR_MISMATCH
    Preondition Violations
    Expression jmax - (value - vp) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression jmin + (value - vp) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24
    return jmin + (value - vp) * (jmax - jmin) / this.period;
    else
    else
    20
    return jmin + (vp - value) * (jmax - jmin) / this.period;
    20
    return jmin + (vp - value) * (jmax - jmin) / this.period;
    25
    return jmax - (vp - value) * (jmax - jmin) / this.period;
    Differences
    Expression1Expression2Difference
    jminjmaxVARIABLE_NAME_MISMATCH
    +-OPERATOR_MISMATCH
    Preondition Violations
    Expression jmin + (vp - value) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression jmax - (vp - value) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25
    return jmax - (vp - value) * (jmax - jmin) / this.period;
    Precondition Violations (7)
    Row Violation
    1Expression value > vp cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression value >= vp cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression jmax - (value - vp) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression jmin + (value - vp) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression jmin + (vp - value) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression jmax - (vp - value) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Not all possible execution flows end in a return statement