if (orientation == PlotOrientation.HORIZONTAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetType); } else if (orientation == PlotOrientation.VERTICAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetType, LengthAdjustmentType.CONTRACT); }
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/category/AbstractCategoryItemRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java
Method name: Point2D calculateDomainMarkerTextAnchorPoint(Graphics2D, PlotOrientation, Rectangle2D, Rectangle2D, RectangleInsets, LengthAdjustmentType, RectangleAnchor) 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.HORIZONTAL) {
1
if (plot.getOrientation() == PlotOrientation.VERTICAL) {
2
            anchorRect = markerOffset.createAdjustedRectangle(markerArea,
2
            
3
                    LengthAdjustmentType.CONTRACT, labelOffsetType
3
        shape = ShapeUtilities.createTranslatedShape(shape,
4
);
4
                            transX1, transY1);
5
        }
5
          
6
      }
6
        else if (orientation == PlotOrientation.VERTICAL) {
7
                else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) {
7
            anchorRect = markerOffset.createAdjustedRectangle(markerArea,
8
            
8
                    labelOffsetType, LengthAdjustmentType.CONTRACT);
9
        shape = ShapeUtilities.createTranslatedShape(shape,
10
                            transY1, transX1);
9
        }
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.6
Clones locationClones are in different classes having the same super class
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)64.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (orientation == PlotOrientation.HORIZONTAL)
    2
    if (orientation == PlotOrientation.HORIZONTAL)
    71
    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
    if (plot.getOrientation() == PlotOrientation.HORIZONTAL)
    3
    anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetType);
    3
    anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetType);
    72
    shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1);
    Differences
    Expression1Expression2Difference
    anchorRectshapeVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.ShapeSUBCLASS_TYPE_MISMATCH
    markerOffset.createAdjustedRectangle(markerArea,LengthAdjustmentType.CONTRACT,labelOffsetType)ShapeUtilities.createTranslatedShape(shape,transY1,transX1)TYPE_COMPATIBLE_REPLACEMENT
    72
    shape = ShapeUtilities.createTranslatedShape(shape, transY1, transX1);
    4
    else if (orientation == PlotOrientation.VERTICAL)
    4
    else if (orientation == PlotOrientation.VERTICAL)
    69
    else if (plot.getOrientation() == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    orientationplot.getOrientation()TYPE_COMPATIBLE_REPLACEMENT
    69
    else if (plot.getOrientation() == PlotOrientation.VERTICAL)
    5
    anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetType, LengthAdjustmentType.CONTRACT);
    5
    anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetType, LengthAdjustmentType.CONTRACT);
    70
    shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1);
    Differences
    Expression1Expression2Difference
    anchorRectshapeVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.ShapeSUBCLASS_TYPE_MISMATCH
    markerOffset.createAdjustedRectangle(markerArea,labelOffsetType,LengthAdjustmentType.CONTRACT)ShapeUtilities.createTranslatedShape(shape,transX1,transY1)TYPE_COMPATIBLE_REPLACEMENT
    70
    shape = ShapeUtilities.createTranslatedShape(shape, transX1, transY1);
    Precondition Violations (2)
    Row Violation
    1Expression plot.getOrientation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variable anchorRect with type java.awt.geom.Rectangle2D , while Clone fragment #2 returns variable shape with type java.awt.Shape