if (edge == RectangleEdge.TOP) { mark = new Line2D.Double( xx, cursor + dataArea.getHeight(), xx, cursor ); } else if (edge == RectangleEdge.BOTTOM) { mark = new Line2D.Double( xx, cursor, xx, cursor - dataArea.getHeight() ); }
if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx)); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen)); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java
Method name: AxisState draw(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge, PlotRenderingInfo) Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (edge == RectangleEdge.TOP) {
1
if (orientation == PlotOrientation.HORIZONTAL) {
2
                mark = new Line2D.Double(
2
                        g2.draw(new Line2D.Double(
3
                    xx, cursor + dataArea.getHeight(), xx, cursor
3
yyOpen, xx + delta, yyOpen,
4
                                xx));
4
                );
5
                    }
5
            }
6
        
6
            else if (edge == RectangleEdge.BOTTOM) {
7
            else if (orientation == PlotOrientation.VERTICAL) {
7
                mark = new Line2D.Double(
8
                        g2.draw(new Line2D.Double(
8
                    xx, cursor, xx, cursor - dataArea.getHeight()
9
        
9
xx - delta, yyOpen, xx,
10
                                yyOpen));
10
        );
11
        
11
            }
12
            }
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.6
Clones locationClones are in different classes
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    if (edge == RectangleEdge.TOP)
    11
    if (edge == RectangleEdge.TOP)
    38
    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
    TOPHORIZONTALVARIABLE_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.TOP 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
    38
    if (orientation == PlotOrientation.HORIZONTAL)
    12
    mark = new Line2D.Double(xx, cursor + dataArea.getHeight(), xx, cursor);
    12
    mark = new Line2D.Double(xx, cursor + dataArea.getHeight(), xx, cursor);
    Preondition Violations
    Unmatched statement mark=new Line2D.Double(xx,cursor + dataArea.getHeight(),xx,cursor); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                  
                                                                                                                            
    39
    g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx));
    13
    else if (edge == RectangleEdge.BOTTOM)
    13
    else if (edge == RectangleEdge.BOTTOM)
    40
    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
    BOTTOMVERTICALVARIABLE_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.BOTTOM 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
    40
    else if (orientation == PlotOrientation.VERTICAL)
    14
    mark = new Line2D.Double(xx, cursor, xx, cursor - dataArea.getHeight());
    14
    mark = new Line2D.Double(xx, cursor, xx, cursor - dataArea.getHeight());
    Preondition Violations
    Unmatched statement mark=new Line2D.Double(xx,cursor,xx,cursor - dataArea.getHeight()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                  
                                                                                                                            
    41
    g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen));
    Precondition Violations (8)
    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.TOP does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL
    4Unmatched statement mark=new Line2D.Double(xx,cursor + dataArea.getHeight(),xx,cursor); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Type org.jfree.ui.RectangleEdge of variable edge does not match with type org.jfree.chart.plot.PlotOrientation of variable orientation
    6Type org.jfree.ui.RectangleEdge does not match with type org.jfree.chart.plot.PlotOrientation
    7Type org.jfree.ui.RectangleEdge of variable RectangleEdge.BOTTOM does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
    8Unmatched statement mark=new Line2D.Double(xx,cursor,xx,cursor - dataArea.getHeight()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted