1582-4-5

if (orientation == PlotOrientation.HORIZONTAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetForRange, LengthAdjustmentType.CONTRACT); } else if (orientation == PlotOrientation.VERTICAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetForRange); }
if (orientation == PlotOrientation.VERTICAL) { areaState.getLine().setLine(transX0, transY0, transX1, transY1); } else if (orientation == PlotOrientation.HORIZONTAL) { areaState.getLine().setLine(transY0, transX0, transY1, transX1); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java
Method name: `Point2D calculateRangeMarkerTextAnchorPoint(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 (orientation == PlotOrientation.VERTICAL) {↵

2

                anchorRect = markerOffset.createAdjustedRectangle(markerArea,↵

2

                ↵

3

                        labelOffsetForRange, LengthAdjustmentType.CONTRACT);↵

4

            }↵

3

                areaState.getLine().setLine(transX0, transY0, transX1,↵

4

                                    transY1);↵

5

                        }↵

5

            else if (orientation == PlotOrientation.VERTICAL) {↵

6

                        else if (orientation == PlotOrientation.HORIZONTAL) {↵

6

                anchorRect = markerOffset.createAdjustedRectangle(markerArea,↵

7

                      ↵

7

                        LengthAdjustmentType.CONTRACT, labelOffsetForRange);↵

8

          areaState.getLine().setLine(transY0, transX0, transY1,↵

9

                                    transX1);↵

8

            }

10

                        }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 13

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 0.6
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   2

       if (orientation == PlotOrientation.HORIZONTAL)

   41

       if (orientation == PlotOrientation.HORIZONTAL)

   3

       anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetForRange, LengthAdjustmentType.CONTRACT);

   3 | anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetForRange, LengthAdjustmentType.CONTRACT);

   Preondition Violations
   Unmatched statement anchorRect=markerOffset.createAdjustedRectangle(markerArea,labelOffsetForRange,LengthAdjustmentType.CONTRACT); cannot be moved, because it updates a variable modified in other unmapped statements

   4

       else if (orientation == PlotOrientation.VERTICAL)

   39

       else if (orientation == PlotOrientation.VERTICAL)

   5

       anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetForRange);

   5 | anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetForRange);

   Preondition Violations
   Unmatched statement anchorRect=markerOffset.createAdjustedRectangle(markerArea,LengthAdjustmentType.CONTRACT,labelOffsetForRange); cannot be moved, because it updates a variable modified in other unmapped statements

   40

       areaState.getLine().setLine(transX0, transY0, transX1, transY1);

   42

       areaState.getLine().setLine(transY0, transX0, transY1, transX1);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Unmatched statement anchorRect=markerOffset.createAdjustedRectangle(markerArea,labelOffsetForRange,LengthAdjustmentType.CONTRACT); cannot be moved, because it updates a variable modified in other unmapped statements
   2 | Unmatched statement anchorRect=markerOffset.createAdjustedRectangle(markerArea,LengthAdjustmentType.CONTRACT,labelOffsetForRange); cannot be moved, because it updates a variable modified in other unmapped statements