if (orientation == PlotOrientation.HORIZONTAL) { // clip top and bottom bounds to data area low = Math.max(low, dataArea.getMinY()); high = Math.min(high, dataArea.getMaxY()); rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); } else if (orientation == PlotOrientation.VERTICAL) { // clip left and right bounds to data area low = Math.max(low, dataArea.getMinX()); high = Math.min(high, dataArea.getMaxX()); rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); }
if (orientation == PlotOrientation.HORIZONTAL) { // clip left and right bounds to data area low = Math.max(low, dataArea.getMinX()); high = Math.min(high, dataArea.getMaxX()); rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); } else if (orientation == PlotOrientation.VERTICAL) { // clip top and bottom bounds to data area low = Math.max(low, dataArea.getMinY()); high = Math.min(high, dataArea.getMaxY()); rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Method name: void drawDomainMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D) Method name: void drawRangeMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (orientation == PlotOrientation.HORIZONTAL) {
1
if (orientation == PlotOrientation.HORIZONTAL) {
2
                // clip top and bottom bounds to data area
2
                // clip left and right bounds to data area
3
                low = Math.max(low, dataArea.getMinY());
3
                low = Math.max(low, dataArea.getMinX());
4
                high = Math.min(high, dataArea.getMaxY());
4
                high = Math.min(high, dataArea.getMaxX());
5
                rect = new Rectangle2D.Double(dataArea.getMinX(),
5
                rect = new Rectangle2D.Double(low,
6
                        low, dataArea.getWidth(),
6
                        dataArea.getMinY(), high - low,
7
                        high - low);
7
                        dataArea.getHeight());
8
            }
8
            }
9
            else if (orientation == PlotOrientation.VERTICAL) {
9
            else if (orientation == PlotOrientation.VERTICAL) {
10
                // clip left and right bounds to data area
10
                // clip top and bottom bounds to data area
11
                low = Math.max(low, dataArea.getMinX());
11
                low = Math.max(low, dataArea.getMinY());
12
                high = Math.min(high, dataArea.getMaxX());
12
                high = Math.min(high, dataArea.getMaxY());
13
                rect = new Rectangle2D.Double(low,
13
                rect = new Rectangle2D.Double(dataArea.getMinX(),
14
                        dataArea.getMinY(), high - low,
14
                        low, dataArea.getWidth(),
15
                        dataArea.getHeight());
15
                        high - low);
16
            }
16
            }
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.4
Clones locationClones are declared in the same class
Number of node comparisons50
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    41
    if (orientation == PlotOrientation.HORIZONTAL)
    41
    if (orientation == PlotOrientation.HORIZONTAL)
    45
    if (orientation == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    HORIZONTALVERTICALVARIABLE_NAME_MISMATCH
    45
    if (orientation == PlotOrientation.VERTICAL)
    42
    low = Math.max(low, dataArea.getMinY());
    46
    low = Math.max(low, dataArea.getMinY());
    43
    high = Math.min(high, dataArea.getMaxY());
    47
    high = Math.min(high, dataArea.getMaxY());
    44
    rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low);
    48
    rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low);
    45
    else if (orientation == PlotOrientation.VERTICAL)
    45
    else if (orientation == PlotOrientation.VERTICAL)
    41
    else if (orientation == PlotOrientation.HORIZONTAL)
    Differences
    Expression1Expression2Difference
    VERTICALHORIZONTALVARIABLE_NAME_MISMATCH
    41
    else if (orientation == PlotOrientation.HORIZONTAL)
    46
    low = Math.max(low, dataArea.getMinX());
    42
    low = Math.max(low, dataArea.getMinX());
    47
    high = Math.min(high, dataArea.getMaxX());
    43
    high = Math.min(high, dataArea.getMaxX());
    48
    rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight());
    44
    rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight());
    Precondition Violations (0)
    Row Violation