if (edge == RectangleEdge.TOP) { used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels()); state.cursorUp(used); } else if (edge == RectangleEdge.BOTTOM) { used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels()); state.cursorDown(used); }
shape = getItemShape(series, item); if (orientation == PlotOrientation.VERTICAL) { shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1); } else if (orientation == PlotOrientation.HORIZONTAL) { shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1); } g2.draw(shape);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer.java
Method name: AxisState drawTickMarksAndLabels(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge) Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (edge == RectangleEdge.TOP) {
1
shape = 
2
                used = findMaximumTickLabelHeight(ticks, g2, plotArea,
3
                        isVerticalTickLabels());
4
                state.cursorUp(used);
5
            }
6
            else if (edge == RectangleEdge.BOTTOM) {
7
                used = findMaximumTickLabelHeight(ticks, g2, plotArea,
8
                        isVerticalTickLabels());
9
                state.cursorDown(used);
10
            }
2
getItemShape(series, item);
3
            if (orientation == PlotOrientation.VERTICAL) {
4
                shape = ShapeUtilities.createTranslatedShape(shape, transX1, 
5
                        transY1);
6
            }
7
            else if (orientation == PlotOrientation.HORIZONTAL) {
8
                shape = ShapeUtilities.createTranslatedShape(shape, transY1, 
9
                        transX1);
10
            }
11
            g2.draw(shape);
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 comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)5.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                            
    56
    shape = getItemShape(series, item);
    Preondition Violations
    Unmatched statement shape=getItemShape(series,item); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    56
    shape = getItemShape(series, item);
    38
    if (edge == RectangleEdge.TOP)
    38
    if (edge == RectangleEdge.TOP)
    57
    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
    TOPVERTICALVARIABLE_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.VERTICAL
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    57
    if (orientation == PlotOrientation.VERTICAL)
    39
    used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels());
    39
    used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels());
    Preondition Violations
    Unmatched statement used=findMaximumTickLabelHeight(ticks,g2,plotArea,isVerticalTickLabels()); cannot be moved, because it updates a variable modified in other unmapped statements
                                                                                                                                                                
    40
    state.cursorUp(used);
    40
    state.cursorUp(used);
    Preondition Violations
    Unmatched statement state.cursorUp(used); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                      
                                                                                                                                                
    58
    shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1);
    Preondition Violations
    Unmatched statement shape=ShapeUtilities.createTranslatedShape(shape,transX1,transY1); cannot be moved, because it updates a variable modified in other unmapped statements
    58
    shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1);
    41
    else if (edge == RectangleEdge.BOTTOM)
    41
    else if (edge == RectangleEdge.BOTTOM)
    59
    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
    BOTTOMHORIZONTALVARIABLE_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.HORIZONTAL
    • Make classes org.jfree.ui.RectangleEdge and org.jfree.chart.plot.PlotOrientation extend a common superclass
    59
    else if (orientation == PlotOrientation.HORIZONTAL)
    42
    used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels());
    42
    used = findMaximumTickLabelHeight(ticks, g2, plotArea, isVerticalTickLabels());
    Preondition Violations
    Unmatched statement used=findMaximumTickLabelHeight(ticks,g2,plotArea,isVerticalTickLabels()); cannot be moved, because it updates a variable modified in other unmapped statements
                                                                                                                                                                
    43
    state.cursorDown(used);
    43
    state.cursorDown(used);
    Preondition Violations
    Unmatched statement state.cursorDown(used); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                          
                                                                                                                                                
    60
    shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1);
    Preondition Violations
    Unmatched statement shape=ShapeUtilities.createTranslatedShape(shape,transY1,transX1); cannot be moved, because it updates a variable modified in other unmapped statements
    60
    shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1);
                                          
    61
    g2.draw(shape);
    Precondition Violations (13)
    Row Violation
    1Unmatched statement shape=getItemShape(series,item); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Type org.jfree.ui.RectangleEdge of variable edge does not match with type org.jfree.chart.plot.PlotOrientation of variable orientation
    3Type org.jfree.ui.RectangleEdge does not match with type org.jfree.chart.plot.PlotOrientation
    4Type org.jfree.ui.RectangleEdge of variable RectangleEdge.TOP does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
    5Unmatched statement state.cursorUp(used); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Type org.jfree.ui.RectangleEdge of variable edge does not match with type org.jfree.chart.plot.PlotOrientation of variable orientation
    7Type org.jfree.ui.RectangleEdge does not match with type org.jfree.chart.plot.PlotOrientation
    8Type org.jfree.ui.RectangleEdge of variable RectangleEdge.BOTTOM does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL
    9Unmatched statement state.cursorDown(used); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Unmatched statement used=findMaximumTickLabelHeight(ticks,g2,plotArea,isVerticalTickLabels()); cannot be moved, because it updates a variable modified in other unmapped statements
    11Unmatched statement used=findMaximumTickLabelHeight(ticks,g2,plotArea,isVerticalTickLabels()); cannot be moved, because it updates a variable modified in other unmapped statements
    12Unmatched statement shape=ShapeUtilities.createTranslatedShape(shape,transX1,transY1); cannot be moved, because it updates a variable modified in other unmapped statements
    13Unmatched statement shape=ShapeUtilities.createTranslatedShape(shape,transY1,transX1); cannot be moved, because it updates a variable modified in other unmapped statements