if (orientation == PlotOrientation.HORIZONTAL) { box = new Rectangle2D.Double(transY0, transX1, transY1 - transY0, transX0 - transX1); } else if (orientation == PlotOrientation.VERTICAL) { box = new Rectangle2D.Double(transX0, transY1, transX1 - transX0, transY0 - transY1); }
if (edge == RectangleEdge.TOP) { mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il); } else if (edge == RectangleEdge.BOTTOM) { mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYBoxAnnotation.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java
Method name: void draw(Graphics2D, XYPlot, Rectangle2D, ValueAxis, ValueAxis, int, PlotRenderingInfo) Method name: AxisState drawTickMarksAndLabels(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (orientation == PlotOrientation.HORIZONTAL) {
1
if (edge == RectangleEdge.TOP) {
2
            box = new Rectangle2D.Double(transY0, transX1, transY1 - transY0, 
2
            
3
                    transX0 - transX1);
3
        mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il);
4
                }
4
        }
5
        
5
        else if (orientation == PlotOrientation.VERTICAL) {
6
        else if (edge == RectangleEdge.BOTTOM) {
6
            box = new Rectangle2D.Double(transX0, transY1, transX1 - transX0, 
7
            
7
                    transY0 - transY1);
8
        mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il);
8
        }
9
                }
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 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)4.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    if (orientation == PlotOrientation.HORIZONTAL)
    9
    if (orientation == PlotOrientation.HORIZONTAL)
    25
    if (edge == RectangleEdge.TOP)
    Differences
    Expression1Expression2Difference
    orientationedgeVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotOrientationorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.PlotOrientationorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    HORIZONTALTOPVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotOrientationorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.PlotOrientation of variable orientation does not match with type org.jfree.ui.RectangleEdge of variable edge
    • Make classes org.jfree.chart.plot.PlotOrientation and org.jfree.ui.RectangleEdge extend a common superclass
    Type org.jfree.chart.plot.PlotOrientation does not match with type org.jfree.ui.RectangleEdge
    • Make classes org.jfree.chart.plot.PlotOrientation and org.jfree.ui.RectangleEdge extend a common superclass
    Type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL does not match with type org.jfree.ui.RectangleEdge of variable RectangleEdge.TOP
    • Make classes org.jfree.chart.plot.PlotOrientation and org.jfree.ui.RectangleEdge extend a common superclass
    25
    if (edge == RectangleEdge.TOP)
    10
    box = new Rectangle2D.Double(transY0, transX1, transY1 - transY0, transX0 - transX1);
    10
    box = new Rectangle2D.Double(transY0, transX1, transY1 - transY0, transX0 - transX1);
    Preondition Violations
    Unmatched statement box=new Rectangle2D.Double(transY0,transX1,transY1 - transY0,transX0 - transX1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                            
                                                                                                                        
    26
    mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il);
    Preondition Violations
    Unmatched statement mark=new Line2D.Double(xx,cursor - ol,xx,cursor + il); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    26
    mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il);
    11
    else if (orientation == PlotOrientation.VERTICAL)
    11
    else if (orientation == PlotOrientation.VERTICAL)
    27
    else if (edge == RectangleEdge.BOTTOM)
    Differences
    Expression1Expression2Difference
    orientationedgeVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotOrientationorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.PlotOrientationorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    VERTICALBOTTOMVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.PlotOrientationorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.PlotOrientation of variable orientation does not match with type org.jfree.ui.RectangleEdge of variable edge
    • Make classes org.jfree.chart.plot.PlotOrientation and org.jfree.ui.RectangleEdge extend a common superclass
    Type org.jfree.chart.plot.PlotOrientation does not match with type org.jfree.ui.RectangleEdge
    • Make classes org.jfree.chart.plot.PlotOrientation and org.jfree.ui.RectangleEdge extend a common superclass
    Type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL does not match with type org.jfree.ui.RectangleEdge of variable RectangleEdge.BOTTOM
    • Make classes org.jfree.chart.plot.PlotOrientation and org.jfree.ui.RectangleEdge extend a common superclass
    27
    else if (edge == RectangleEdge.BOTTOM)
    12
    box = new Rectangle2D.Double(transX0, transY1, transX1 - transX0, transY0 - transY1);
    12
    box = new Rectangle2D.Double(transX0, transY1, transX1 - transX0, transY0 - transY1);
    Preondition Violations
    Unmatched statement box=new Rectangle2D.Double(transX0,transY1,transX1 - transX0,transY0 - transY1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                            
                                                                                                                        
    28
    mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il);
    Preondition Violations
    Unmatched statement mark=new Line2D.Double(xx,cursor + ol,xx,cursor - il); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    28
    mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il);
    Precondition Violations (10)
    Row Violation
    1Type org.jfree.chart.plot.PlotOrientation of variable orientation does not match with type org.jfree.ui.RectangleEdge of variable edge
    2Type org.jfree.chart.plot.PlotOrientation does not match with type org.jfree.ui.RectangleEdge
    3Type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL does not match with type org.jfree.ui.RectangleEdge of variable RectangleEdge.TOP
    4Unmatched statement box=new Rectangle2D.Double(transY0,transX1,transY1 - transY0,transX0 - transX1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement mark=new Line2D.Double(xx,cursor - ol,xx,cursor + il); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Type org.jfree.chart.plot.PlotOrientation of variable orientation does not match with type org.jfree.ui.RectangleEdge of variable edge
    7Type org.jfree.chart.plot.PlotOrientation does not match with type org.jfree.ui.RectangleEdge
    8Type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL does not match with type org.jfree.ui.RectangleEdge of variable RectangleEdge.BOTTOM
    9Unmatched statement box=new Rectangle2D.Double(transX0,transY1,transX1 - transX0,transY0 - transY1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Unmatched statement mark=new Line2D.Double(xx,cursor + ol,xx,cursor - il); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted