if (edge == RectangleEdge.LEFT) { axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, dataArea.getMaxY()); } else if (edge == RectangleEdge.RIGHT) { axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, dataArea.getMaxY()); }
if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/Axis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Method name: void drawAxisLine(Graphics2D, double, Rectangle2D, RectangleEdge) Method name: void drawDomainMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (edge == RectangleEdge.LEFT) {
1
if (orientation == PlotOrientation.HORIZONTAL) {
2
            axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor,
2
                line = new Line2D.Double(dataArea.get
3
MinX(), v,
3
                    dataArea.getMaxY());
4
                        dataArea.getMaxX(), v);
4
        }
5
         
6
   }
5
        else if (edge == RectangleEdge.RIGHT) {
7
            else if (orientation == PlotOrientation.VERTICAL) {
6
            axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor,
8
                line = new Line2D.Double(v, dataArea.getMinY(), 
9
v,
7
                    dataArea.getMaxY());
10
                        dataArea.getMaxY());
8
        }
11
            }
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.5
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    else if (edge == RectangleEdge.LEFT)
    6
    else if (edge == RectangleEdge.LEFT)
    12
    else if (orientation == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    edgeorientationVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    org.jfree.ui.RectangleEdgeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    LEFTVERTICALVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleEdge of variable edge does not match with type org.jfree.chart.plot.PlotOrientation of variable orientation
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    Type org.jfree.ui.RectangleEdge does not match with type org.jfree.chart.plot.PlotOrientation
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    Type org.jfree.ui.RectangleEdge of variable RectangleEdge.LEFT does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    12
    else if (orientation == PlotOrientation.VERTICAL)
    7
    axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, dataArea.getMaxY());
    7
    axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, dataArea.getMaxY());
    13
    line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());
    Differences
    Expression1Expression2Difference
    axisLinelineVARIABLE_NAME_MISMATCH
    cursorvVARIABLE_NAME_MISMATCH
    getYgetMinYMETHOD_INVOCATION_NAME_MISMATCH
    cursorvVARIABLE_NAME_MISMATCH
    13
    line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());
    8
    else if (edge == RectangleEdge.RIGHT)
    8
    else if (edge == RectangleEdge.RIGHT)
    10
    else if (orientation == PlotOrientation.HORIZONTAL)
    Differences
    Expression1Expression2Difference
    edgeorientationVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    org.jfree.ui.RectangleEdgeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    RIGHTHORIZONTALVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleEdge of variable edge does not match with type org.jfree.chart.plot.PlotOrientation of variable orientation
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    Type org.jfree.ui.RectangleEdge does not match with type org.jfree.chart.plot.PlotOrientation
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    Type org.jfree.ui.RectangleEdge of variable RectangleEdge.RIGHT does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    10
    else if (orientation == PlotOrientation.HORIZONTAL)
    9
    axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, dataArea.getMaxY());
    9
    axisLine = new Line2D.Double(cursor, dataArea.getY(), cursor, dataArea.getMaxY());
    11
    line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);
    Differences
    Expression1Expression2Difference
    axisLinelineVARIABLE_NAME_MISMATCH
    cursordataArea.getMinX()TYPE_COMPATIBLE_REPLACEMENT
    dataArea.getY()vTYPE_COMPATIBLE_REPLACEMENT
    cursordataArea.getMaxX()TYPE_COMPATIBLE_REPLACEMENT
    dataArea.getMaxY()vTYPE_COMPATIBLE_REPLACEMENT
    11
    line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);
    Precondition Violations (6)
    Row Violation
    1Type org.jfree.ui.RectangleEdge of variable edge does not match with type org.jfree.chart.plot.PlotOrientation of variable orientation
    2Type org.jfree.ui.RectangleEdge does not match with type org.jfree.chart.plot.PlotOrientation
    3Type org.jfree.ui.RectangleEdge of variable RectangleEdge.LEFT does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
    4Type org.jfree.ui.RectangleEdge of variable edge does not match with type org.jfree.chart.plot.PlotOrientation of variable orientation
    5Type org.jfree.ui.RectangleEdge does not match with type org.jfree.chart.plot.PlotOrientation
    6Type org.jfree.ui.RectangleEdge of variable RectangleEdge.RIGHT does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL