if (RectangleEdge.isTopOrBottom(edge)) { min = area.getX(); max = area.getX() + area.getWidth() * length1 / (length1 + length2); } else if (RectangleEdge.isLeftOrRight(edge)) { min = area.getMaxY(); max = area.getMaxY() - area.getHeight() * length1 / (length1 + length2); }
if (RectangleEdge.isTopOrBottom(edge)) { max = area.getMaxX(); min = area.getMaxX() - area.getWidth() * length2 / (length1 + length2); } else if (RectangleEdge.isLeftOrRight(edge)) { max = area.getMinY(); min = area.getMinY() + area.getHeight() * length2 / (length1 + length2); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ModuloAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ModuloAxis.java
Method name: double transStart(double, Rectangle2D, RectangleEdge, double, double) Method name: double transEnd(double, Rectangle2D, RectangleEdge, double, double)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (RectangleEdge.isTopOrBottom(edge)) {
1
if (RectangleEdge.isTopOrBottom(edge)) {
2
            min = area.getX();
2
            max = area.getMaxX();
3
            max = area.getX() + area.getWidth() * length1
3
            min = area.getMaxX() - area.getWidth() * length2 
4
 / (length1 + length2);
4
                  / (length1 + length2);
5
        }
5
        }
6
        else if (RectangleEdge.isLeftOrRight(edge)) {
6
        else if (RectangleEdge.isLeftOrRight(edge)) {
7
            min = area.getMaxY();
7
            max = area.getMinY();
8
            max = area.getMaxY() - area.getHeight() * length1 
8
            min = area.getMinY() + area.getHeight() * length2 
9
                  / (length1 + length2);
9
                  / (length1 + length2);
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.3
Clones locationClones are declared in the same class
Number of node comparisons28
  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)6.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (RectangleEdge.isTopOrBottom(edge))
    3
    if (RectangleEdge.isTopOrBottom(edge))
    4
    min = area.getX();
    4
    min = area.getX();
    4
    max = area.getMaxX();
    Differences
    Expression1Expression2Difference
    minmaxVARIABLE_NAME_MISMATCH
    getXgetMaxXMETHOD_INVOCATION_NAME_MISMATCH
    4
    max = area.getMaxX();
    5
    max = area.getX() + area.getWidth() * length1 / (length1 + length2);
    5
    max = area.getX() + area.getWidth() * length1 / (length1 + length2);
    5
    min = area.getMaxX() - area.getWidth() * length2 / (length1 + length2);
    Differences
    Expression1Expression2Difference
    maxminVARIABLE_NAME_MISMATCH
    getXgetMaxXMETHOD_INVOCATION_NAME_MISMATCH
    length1length2VARIABLE_NAME_MISMATCH
    +-OPERATOR_MISMATCH
    5
    min = area.getMaxX() - area.getWidth() * length2 / (length1 + length2);
    6
    else if (RectangleEdge.isLeftOrRight(edge))
    6
    else if (RectangleEdge.isLeftOrRight(edge))
    7
    min = area.getMaxY();
    7
    min = area.getMaxY();
    7
    max = area.getMinY();
    Differences
    Expression1Expression2Difference
    minmaxVARIABLE_NAME_MISMATCH
    getMaxYgetMinYMETHOD_INVOCATION_NAME_MISMATCH
    7
    max = area.getMinY();
    8
    max = area.getMaxY() - area.getHeight() * length1 / (length1 + length2);
    8
    max = area.getMaxY() - area.getHeight() * length1 / (length1 + length2);
    8
    min = area.getMinY() + area.getHeight() * length2 / (length1 + length2);
    Differences
    Expression1Expression2Difference
    maxminVARIABLE_NAME_MISMATCH
    getMaxYgetMinYMETHOD_INVOCATION_NAME_MISMATCH
    length1length2VARIABLE_NAME_MISMATCH
    -+OPERATOR_MISMATCH
    8
    min = area.getMinY() + area.getHeight() * length2 / (length1 + length2);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables min, max , while Clone fragment #2 returns variables max, min