if (orientation == PlotOrientation.VERTICAL) { areaState.getLine().setLine(transX0, transY0, transX1, transY1); } else if (orientation == PlotOrientation.HORIZONTAL) { areaState.getLine().setLine(transY0, transX0, transY1, transX1); }
if (plot.getOrientation() == PlotOrientation.VERTICAL) { shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1); } else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) 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 (orientation == PlotOrientation.VERTICAL) {
1
if (plot.getOrientation() == PlotOrientation.VERTICAL) {
2
                        areaState.getLine().setLine(transX0, transY0, transX1,
2
                    shape = ShapeUtilities.createTranslatedShape(shape,
3
                                transY1);
3
                            transX1, transY1);
4
                    }
4
                }
5
                    else if (orientation == PlotOrientation.HORIZONTAL) {
5
                else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) {
6
                        areaState.getLine().setLine(transY0, transX0, transY1,
6
                    
7
    
7
shape = ShapeUtilities.createTranslatedShape(shape,
8
                            transX1);
8
                            transY1, transX1);
9
                    }
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 the same method
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)59.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    39
    if (orientation == PlotOrientation.VERTICAL)
    39
    if (orientation == PlotOrientation.VERTICAL)
    69
    if (plot.getOrientation() == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    orientationplot.getOrientation()TYPE_COMPATIBLE_REPLACEMENT
    69
    if (plot.getOrientation() == PlotOrientation.VERTICAL)
    40
    areaState.getLine().setLine(transX0, transY0, transX1, transY1);
                                                                                                                                      
                                                                                                                                                
    70
    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
    70
    shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1);
    41
    else if (orientation == PlotOrientation.HORIZONTAL)
    41
    else if (orientation == PlotOrientation.HORIZONTAL)
    71
    else if (plot.getOrientation() == PlotOrientation.HORIZONTAL)
    Differences
    Expression1Expression2Difference
    orientationplot.getOrientation()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression plot.getOrientation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    71
    else if (plot.getOrientation() == PlotOrientation.HORIZONTAL)
    42
    areaState.getLine().setLine(transY0, transX0, transY1, transX1);
                                                                                                                                      
                                                                                                                                                
    72
    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
    72
    shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1);
    Precondition Violations (3)
    Row Violation
    1Expression plot.getOrientation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement shape=ShapeUtilities.createTranslatedShape(shape,transX1,transY1); cannot be moved, because it updates a variable modified in other unmapped statements
    3Unmatched statement shape=ShapeUtilities.createTranslatedShape(shape,transY1,transX1); cannot be moved, because it updates a variable modified in other unmapped statements