if (this.fixedRangeAxisSpace != null) { if (this.orientation == PlotOrientation.HORIZONTAL) { space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(), RectangleEdge.TOP); space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(), RectangleEdge.BOTTOM); } else if (this.orientation == PlotOrientation.VERTICAL) { space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(), RectangleEdge.LEFT); space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(), RectangleEdge.RIGHT); } } else { // reserve space for the range axes (if any)... for (int i = 0; i < this.rangeAxes.size(); i++) { Axis yAxis = (Axis) this.rangeAxes.get(i); if (yAxis != null) { RectangleEdge edge = getRangeAxisEdge(i); space = yAxis.reserveSpace(g2, this, plotArea, edge, space); } } }
if (this.fixedRangeAxisSpace != null) { if (this.orientation == PlotOrientation.HORIZONTAL) { space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(), RectangleEdge.TOP); space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(), RectangleEdge.BOTTOM); } else if (this.orientation == PlotOrientation.VERTICAL) { space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(), RectangleEdge.LEFT); space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(), RectangleEdge.RIGHT); } } else { // reserve space for the range axes... for (int i = 0; i < this.rangeAxes.size(); i++) { Axis axis = (Axis) this.rangeAxes.get(i); if (axis != null) { RectangleEdge edge = getRangeAxisEdge(i); space = axis.reserveSpace(g2, this, plotArea, edge, space); } } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: AxisSpace calculateRangeAxisSpace(Graphics2D, Rectangle2D, AxisSpace) Method name: AxisSpace calculateRangeAxisSpace(Graphics2D, Rectangle2D, AxisSpace)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (this.fixedRangeAxisSpace != null) {
1
if (this.fixedRangeAxisSpace != null) {
2
            if (this.orientation == PlotOrientation.HORIZONTAL) {
2
            if (this.orientation == PlotOrientation.HORIZONTAL) {
3
                space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(),
3
                space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(),
4
                        RectangleEdge.TOP);
4
                        RectangleEdge.TOP);
5
                space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(),
5
                space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(),
6
                        RectangleEdge.BOTTOM);
6
                        RectangleEdge.BOTTOM);
7
            }
7
            }
8
            else if (this.orientation == PlotOrientation.VERTICAL) {
8
            else if (this.orientation == PlotOrientation.VERTICAL) {
9
                space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(),
9
                space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(),
10
                        RectangleEdge.LEFT);
10
                        RectangleEdge.LEFT);
11
                space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(),
11
                space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(),
12
                        RectangleEdge.RIGHT);
12
                        RectangleEdge.RIGHT);
13
            }
13
            }
14
        }
14
        }
15
        else {
15
        else {
16
            // reserve space for the range axes (if any)...
16
            // reserve space for the range axes...
17
            for (int i = 0; i < this.rangeAxes.size(); i++) {
17
            for (int i = 0; i < this.rangeAxes.size(); i++) {
18
                Axis yAxis = (Axis) this.rangeAxes.get(i);
18
                Axis axis = (Axis) this.rangeAxes.get(i);
19
                if (yAxis != null) {
19
                if (axis != null) {
20
                    RectangleEdge edge = getRangeAxisEdge(i);
20
                    RectangleEdge edge = getRangeAxisEdge(i);
21
                    space = yAxis.reserveSpace(g2, this, plotArea, edge, space);
21
                    space = axis.reserveSpace(g2, this, plotArea, edge, space);
22
                }
22
                }
23
            }
23
            }
24
        }
24
        }
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)3.1
Clones locationClones are in different classes having the same super class
Number of node comparisons46
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)24.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (this.fixedRangeAxisSpace != null)
    3
    if (this.fixedRangeAxisSpace != null)
    4
    if (this.orientation == PlotOrientation.HORIZONTAL)
    4
    if (this.orientation == PlotOrientation.HORIZONTAL)
    5
    space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(), RectangleEdge.TOP);
    5
    space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(), RectangleEdge.TOP);
    6
    space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(), RectangleEdge.BOTTOM);
    6
    space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(), RectangleEdge.BOTTOM);
    7
    else if (this.orientation == PlotOrientation.VERTICAL)
    7
    else if (this.orientation == PlotOrientation.VERTICAL)
    8
    space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(), RectangleEdge.LEFT);
    8
    space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(), RectangleEdge.LEFT);
    9
    space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(), RectangleEdge.RIGHT);
    9
    space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(), RectangleEdge.RIGHT);
    else
    else
    10
    for (int i = 0; i < this.rangeAxes.size(); i++)
    10
    for (int i = 0; i < this.rangeAxes.size(); i++)
    11
    Axis yAxis = (Axis)this.rangeAxes.get(i);
    11
    Axis yAxis = (Axis)this.rangeAxes.get(i);
    11
    Axis axis = (Axis)this.rangeAxes.get(i);
    Differences
    Expression1Expression2Difference
    yAxisaxisVARIABLE_NAME_MISMATCH
    11
    Axis axis = (Axis)this.rangeAxes.get(i);
    12
    if (yAxis != null)
    12
    if (yAxis != null)
    12
    if (axis != null)
    Differences
    Expression1Expression2Difference
    yAxisaxisVARIABLE_NAME_MISMATCH
    12
    if (axis != null)
    13
    RectangleEdge edge = getRangeAxisEdge(i);
    13
    RectangleEdge edge = getRangeAxisEdge(i);
    14
    space = yAxis.reserveSpace(g2, this, plotArea, edge, space);
    14
    space = yAxis.reserveSpace(g2, this, plotArea, edge, space);
    14
    space = axis.reserveSpace(g2, this, plotArea, edge, space);
    Differences
    Expression1Expression2Difference
    yAxisaxisVARIABLE_NAME_MISMATCH
    14
    space = axis.reserveSpace(g2, this, plotArea, edge, space);
    Precondition Violations (0)
    Row Violation