1039-4-7

if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, path.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); }
if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer3D.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Method name: `void drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, Rectangle2D)` |  | Method name: `void drawRangeMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (label != null) {↵

1

    if (label != null) {↵

2

                    Font labelFont = marker.getLabelFont();↵

2

                    Font labelFont = marker.getLabelFont();↵

3

                    g2.setFont(labelFont);↵

3

                    g2.setFont(labelFont);↵

4

                    g2.setPaint(marker.getLabelPaint());↵

4

                    g2.setPaint(marker.getLabelPaint());↵

5

                    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(↵

5

                    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(↵

6

                            g2, orientation, dataArea, path.getBounds2D(),↵

6

                            g2, orientation, dataArea, line.getBounds2D(),↵

7

                            marker.getLabelOffset(),↵

7

                            marker.getLabelOffset(),↵

8

     LengthAdjustmentType.EXPAND,↵

8

                            LengthAdjustmentType.EXPAND,↵

9

                            anchor);↵

9

     anchor);↵

10

                    TextUtilities.drawAlignedString(label, g2,↵

10

                    TextUtilities.drawAlignedString(label, g2,↵

11

                            (float) coordinates.getX(), (float) coordinates.getY(),↵

11

                            (float) coordinates.getX(), (float) coordinates.getY(),↵

12

                            marker.getLabelTextAnchor());↵

12

                            marker.getLabelTextAnchor());↵

13

                }

13

                }

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.1
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 37

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   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) | 2.0
   Clone type | Type 2

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

   34

       if (label != null)

   21

       if (label != null)

   35

       Font labelFont = marker.getLabelFont();

   22

       Font labelFont = marker.getLabelFont();

   36

       g2.setFont(labelFont);

   23

       g2.setFont(labelFont);

   37

       g2.setPaint(marker.getLabelPaint());

   24

       g2.setPaint(marker.getLabelPaint());

   38

       Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, path.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor);

   38 | Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, path.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor);
   25 | Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   path | line | VARIABLE_NAME_MISMATCH
   java.awt.geom.GeneralPath | java.awt.geom.Line2D | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.geom.GeneralPath of variable path does not match with type java.awt.geom.Line2D of variable line
   - Make classes java.awt.geom.GeneralPath and java.awt.geom.Line2D extend a common superclass

   25

       Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor);

   39

       TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());

   26

       TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Type java.awt.geom.GeneralPath of variable path does not match with type java.awt.geom.Line2D of variable line