if (fixed != null) { if (orientation == PlotOrientation.VERTICAL) { space.setLeft(fixed.getLeft()); space.setRight(fixed.getRight()); } else if (orientation == PlotOrientation.HORIZONTAL) { space.setTop(fixed.getTop()); space.setBottom(fixed.getBottom()); } } else { ValueAxis valueAxis = getRangeAxis(); RectangleEdge valueEdge = Plot.resolveRangeAxisLocation( getRangeAxisLocation(), orientation); if (valueAxis != null) { space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space); } }
if (fixed != null) { if (orientation == PlotOrientation.VERTICAL) { space.setLeft(fixed.getLeft()); space.setRight(fixed.getRight()); } else if (orientation == PlotOrientation.HORIZONTAL) { space.setTop(fixed.getTop()); space.setBottom(fixed.getBottom()); } } else { ValueAxis valueAxis = getRangeAxis(); RectangleEdge valueEdge = Plot.resolveRangeAxisLocation( getRangeAxisLocation(), orientation ); if (valueAxis != null) { space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java
Method name: AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D) Method name: AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (fixed != null) {
1
if (fixed != null) {
2
            if (orientation == PlotOrientation.VERTICAL) {
2
            if (orientation == PlotOrientation.VERTICAL) {
3
                space.setLeft(fixed.getLeft());
3
                space.setLeft(fixed.getLeft());
4
                space.setRight(fixed.getRight());
4
                space.setRight(fixed.getRight());
5
            }
5
            }
6
            else if (orientation == PlotOrientation.HORIZONTAL) {
6
            else if (orientation == PlotOrientation.HORIZONTAL) {
7
                space.setTop(fixed.getTop());
7
                space.setTop(fixed.getTop());
8
                space.setBottom(fixed.getBottom());                
8
                space.setBottom(fixed.getBottom());
9
            }
9
            }
10
        }
10
        }
11
        else {
11
        else {
12
            ValueAxis valueAxis = getRangeAxis();
12
            ValueAxis valueAxis = getRangeAxis();
13
            RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(
13
            RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(
14
                    getRangeAxisLocation(), orientation
14
                getRangeAxisLocation(), orientation
15
);
15
            );
16
            if (valueAxis != null) {
16
            if (valueAxis != null) {
17
                space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, 
17
                space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge,
18
                        space);
18
                        space);
19
            }
19
            }
20
        }
20
        }
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.8
Clones locationClones are in different classes having the same super class
Number of node comparisons50
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    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.9
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    4
    if (fixed != null)
    4
    if (fixed != null)
    5
    if (orientation == PlotOrientation.VERTICAL)
    5
    if (orientation == PlotOrientation.VERTICAL)
    6
    space.setLeft(fixed.getLeft());
    6
    space.setLeft(fixed.getLeft());
    7
    space.setRight(fixed.getRight());
    7
    space.setRight(fixed.getRight());
    8
    else if (orientation == PlotOrientation.HORIZONTAL)
    8
    else if (orientation == PlotOrientation.HORIZONTAL)
    9
    space.setTop(fixed.getTop());
    9
    space.setTop(fixed.getTop());
    10
    space.setBottom(fixed.getBottom());
    10
    space.setBottom(fixed.getBottom());
    else
    else
    11
    ValueAxis valueAxis = getRangeAxis();
    11
    ValueAxis valueAxis = getRangeAxis();
    12
    RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(getRangeAxisLocation(), orientation);
    12
    RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(getRangeAxisLocation(), orientation);
    13
    if (valueAxis != null)
    13
    if (valueAxis != null)
    14
    space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space);
    14
    space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space);
    Precondition Violations (0)
    Row Violation