if (location == AxisLocation.TOP_OR_RIGHT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.RIGHT; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.TOP; } } else if (location == AxisLocation.TOP_OR_LEFT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.LEFT; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.TOP; } } else if (location == AxisLocation.BOTTOM_OR_RIGHT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.RIGHT; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.BOTTOM; } } else if (location == AxisLocation.BOTTOM_OR_LEFT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.LEFT; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.BOTTOM; } }
if (location == AxisLocation.TOP_OR_RIGHT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.TOP; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.RIGHT; } } else if (location == AxisLocation.TOP_OR_LEFT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.TOP; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.LEFT; } } else if (location == AxisLocation.BOTTOM_OR_RIGHT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.BOTTOM; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.RIGHT; } } else if (location == AxisLocation.BOTTOM_OR_LEFT) { if (orientation == PlotOrientation.HORIZONTAL) { result = RectangleEdge.BOTTOM; } else if (orientation == PlotOrientation.VERTICAL) { result = RectangleEdge.LEFT; } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/Plot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/Plot.java
Method name: RectangleEdge resolveDomainAxisLocation(AxisLocation, PlotOrientation) Method name: RectangleEdge resolveRangeAxisLocation(AxisLocation, PlotOrientation)
Number of AST nodes: 20 Number of AST nodes: 20
1
if (location == AxisLocation.TOP_OR_RIGHT) {
1
if (location == AxisLocation.TOP_OR_RIGHT) {
2
            if (orientation == PlotOrientation.HORIZONTAL) {
2
            if (orientation == PlotOrientation.HORIZONTAL) {
3
                result = RectangleEdge.RIGHT;
3
                result = RectangleEdge.TOP;
4
            }
4
            }
5
            else if (orientation == PlotOrientation.VERTICAL) {
5
            else if (orientation == PlotOrientation.VERTICAL) {
6
                result = RectangleEdge.TOP;
6
                result = RectangleEdge.RIGHT;
7
            }
7
            }
8
        }
8
        }
9
        else if (location == AxisLocation.TOP_OR_LEFT) {
9
        else if (location == AxisLocation.TOP_OR_LEFT) {
10
            if (orientation == PlotOrientation.HORIZONTAL) {
10
            if (orientation == PlotOrientation.HORIZONTAL) {
11
                result = RectangleEdge.LEFT;
11
                result = RectangleEdge.TOP;
12
            }
12
            }
13
            else if (orientation == PlotOrientation.VERTICAL) {
13
            else if (orientation == PlotOrientation.VERTICAL) {
14
                result = RectangleEdge.TOP;
14
                result = RectangleEdge.LEFT;
15
            }
15
            }
16
        }
16
        }
17
        else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
17
        else if (location == AxisLocation.BOTTOM_OR_RIGHT) {
18
            if (orientation == PlotOrientation.HORIZONTAL) {
18
            if (orientation == PlotOrientation.HORIZONTAL) {
19
                result = RectangleEdge.RIGHT;
19
                result = RectangleEdge.BOTTOM;
20
            }
20
            }
21
            else if (orientation == PlotOrientation.VERTICAL) {
21
            else if (orientation == PlotOrientation.VERTICAL) {
22
                result = RectangleEdge.BOTTOM;
22
                result = RectangleEdge.RIGHT;
23
            }
23
            }
24
        }
24
        }
25
        else if (location == AxisLocation.BOTTOM_OR_LEFT) {
25
        else if (location == AxisLocation.BOTTOM_OR_LEFT) {
26
            if (orientation == PlotOrientation.HORIZONTAL) {
26
            if (orientation == PlotOrientation.HORIZONTAL) {
27
                result = RectangleEdge.LEFT;
27
                result = RectangleEdge.BOTTOM;
28
            }
28
            }
29
            else if (orientation == PlotOrientation.VERTICAL) {
29
            else if (orientation == PlotOrientation.VERTICAL) {
30
                result = RectangleEdge.BOTTOM;
30
                result = RectangleEdge.LEFT;
31
            }
31
            }
32
        }
32
        }
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)5.9
Clones locationClones are declared in the same class
Number of node comparisons152
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements20
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (location == AxisLocation.TOP_OR_RIGHT)
    6
    if (location == AxisLocation.TOP_OR_RIGHT)
    7
    if (orientation == PlotOrientation.HORIZONTAL)
    7
    if (orientation == PlotOrientation.HORIZONTAL)
    8
    result = RectangleEdge.RIGHT;
    8
    result = RectangleEdge.RIGHT;
    8
    result = RectangleEdge.TOP;
    Differences
    Expression1Expression2Difference
    RIGHTTOPVARIABLE_NAME_MISMATCH
    8
    result = RectangleEdge.TOP;
    9
    else if (orientation == PlotOrientation.VERTICAL)
    9
    else if (orientation == PlotOrientation.VERTICAL)
    10
    result = RectangleEdge.TOP;
    10
    result = RectangleEdge.TOP;
    10
    result = RectangleEdge.RIGHT;
    Differences
    Expression1Expression2Difference
    TOPRIGHTVARIABLE_NAME_MISMATCH
    10
    result = RectangleEdge.RIGHT;
    11
    else if (location == AxisLocation.TOP_OR_LEFT)
    11
    else if (location == AxisLocation.TOP_OR_LEFT)
    12
    if (orientation == PlotOrientation.HORIZONTAL)
    12
    if (orientation == PlotOrientation.HORIZONTAL)
    13
    result = RectangleEdge.LEFT;
    13
    result = RectangleEdge.LEFT;
    13
    result = RectangleEdge.TOP;
    Differences
    Expression1Expression2Difference
    LEFTTOPVARIABLE_NAME_MISMATCH
    13
    result = RectangleEdge.TOP;
    14
    else if (orientation == PlotOrientation.VERTICAL)
    14
    else if (orientation == PlotOrientation.VERTICAL)
    15
    result = RectangleEdge.TOP;
    15
    result = RectangleEdge.TOP;
    15
    result = RectangleEdge.LEFT;
    Differences
    Expression1Expression2Difference
    TOPLEFTVARIABLE_NAME_MISMATCH
    15
    result = RectangleEdge.LEFT;
    16
    else if (location == AxisLocation.BOTTOM_OR_RIGHT)
    16
    else if (location == AxisLocation.BOTTOM_OR_RIGHT)
    17
    if (orientation == PlotOrientation.HORIZONTAL)
    17
    if (orientation == PlotOrientation.HORIZONTAL)
    18
    result = RectangleEdge.RIGHT;
    18
    result = RectangleEdge.RIGHT;
    18
    result = RectangleEdge.BOTTOM;
    Differences
    Expression1Expression2Difference
    RIGHTBOTTOMVARIABLE_NAME_MISMATCH
    18
    result = RectangleEdge.BOTTOM;
    19
    else if (orientation == PlotOrientation.VERTICAL)
    19
    else if (orientation == PlotOrientation.VERTICAL)
    20
    result = RectangleEdge.BOTTOM;
    20
    result = RectangleEdge.BOTTOM;
    20
    result = RectangleEdge.RIGHT;
    Differences
    Expression1Expression2Difference
    BOTTOMRIGHTVARIABLE_NAME_MISMATCH
    20
    result = RectangleEdge.RIGHT;
    21
    else if (location == AxisLocation.BOTTOM_OR_LEFT)
    21
    else if (location == AxisLocation.BOTTOM_OR_LEFT)
    22
    if (orientation == PlotOrientation.HORIZONTAL)
    22
    if (orientation == PlotOrientation.HORIZONTAL)
    23
    result = RectangleEdge.LEFT;
    23
    result = RectangleEdge.LEFT;
    23
    result = RectangleEdge.BOTTOM;
    Differences
    Expression1Expression2Difference
    LEFTBOTTOMVARIABLE_NAME_MISMATCH
    23
    result = RectangleEdge.BOTTOM;
    24
    else if (orientation == PlotOrientation.VERTICAL)
    24
    else if (orientation == PlotOrientation.VERTICAL)
    25
    result = RectangleEdge.BOTTOM;
    25
    result = RectangleEdge.BOTTOM;
    25
    result = RectangleEdge.LEFT;
    Differences
    Expression1Expression2Difference
    BOTTOMLEFTVARIABLE_NAME_MISMATCH
    25
    result = RectangleEdge.LEFT;
    Precondition Violations (0)
    Row Violation