1582-3-4

if (orientation == PlotOrientation.HORIZONTAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetType); } else if (orientation == PlotOrientation.VERTICAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetType, LengthAdjustmentType.CONTRACT); }
if (orientation == PlotOrientation.HORIZONTAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, labelOffsetForRange, LengthAdjustmentType.CONTRACT); } else if (orientation == PlotOrientation.VERTICAL) { anchorRect = markerOffset.createAdjustedRectangle(markerArea, LengthAdjustmentType.CONTRACT, labelOffsetForRange); }

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/AbstractXYItemRenderer.java
Method name: `Point2D calculateDomainMarkerTextAnchorPoint(Graphics2D, PlotOrientation, Rectangle2D, Rectangle2D, RectangleInsets, LengthAdjustmentType, RectangleAnchor)` |  | Method name: `Point2D calculateRangeMarkerTextAnchorPoint(Graphics2D, PlotOrientation, Rectangle2D, Rectangle2D, RectangleInsets, LengthAdjustmentType, RectangleAnchor)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

2

                anchorRect = markerOffset.createAdjustedRectangle(markerArea,↵

2

                anchorRect = markerOffset.createAdjustedRectangle(markerArea,↵

3

                        LengthAdjustmentType.CONTRACT, labelOffsetType);↵

3

                        labelOffsetForRange, LengthAdjustmentType.CONTRACT);↵

4

            }↵

4

            }↵

5

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

5

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

6

                anchorRect = markerOffset.createAdjustedRectangle(markerArea,↵

6

                anchorRect = markerOffset.createAdjustedRectangle(markerArea,↵

7

                        labelOffsetType, LengthAdjustmentType.CONTRACT);↵

7

                        LengthAdjustmentType.CONTRACT, labelOffsetForRange);↵

8

            }

8

            }

See real code fragment |  | See real code fragment

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

1. {Refactorable}

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

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

   2

       if (orientation == PlotOrientation.HORIZONTAL)

   2

       if (orientation == PlotOrientation.HORIZONTAL)

   3

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   LengthAdjustmentType.CONTRACT | labelOffsetForRange | TYPE_COMPATIBLE_REPLACEMENT
   labelOffsetType | LengthAdjustmentType.CONTRACT | TYPE_COMPATIBLE_REPLACEMENT

   3

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

   4

       else if (orientation == PlotOrientation.VERTICAL)

   4

       else if (orientation == PlotOrientation.VERTICAL)

   5

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   labelOffsetType | LengthAdjustmentType.CONTRACT | TYPE_COMPATIBLE_REPLACEMENT
   LengthAdjustmentType.CONTRACT | labelOffsetForRange | TYPE_COMPATIBLE_REPLACEMENT

   5

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

   Precondition Violations (0)
   Row | Violation
   --- | ---