399-1-2

if (anchor == ItemLabelAnchor.OUTSIDE5) { result = new Point2D.Double(x5, y0); } else if (anchor == ItemLabelAnchor.OUTSIDE6) { result = new Point2D.Double(x3, y0); } else if (anchor == ItemLabelAnchor.OUTSIDE7) { result = new Point2D.Double(x1, y0); } else if (anchor == ItemLabelAnchor.OUTSIDE8) { result = new Point2D.Double(x0, y1); } else if (anchor == ItemLabelAnchor.OUTSIDE9) { result = new Point2D.Double(x0, y3); } else if (anchor == ItemLabelAnchor.OUTSIDE10) { result = new Point2D.Double(x0, y5); } else if (anchor == ItemLabelAnchor.OUTSIDE11) { result = new Point2D.Double(x1, y6); } else if (anchor == ItemLabelAnchor.OUTSIDE12) { result = new Point2D.Double(x3, y6); }
if (anchor == ItemLabelAnchor.OUTSIDE5) { result = new Point2D.Double(x5, y0); } else if (anchor == ItemLabelAnchor.OUTSIDE6) { result = new Point2D.Double(x3, y0); } else if (anchor == ItemLabelAnchor.OUTSIDE7) { result = new Point2D.Double(x1, y0); } else if (anchor == ItemLabelAnchor.OUTSIDE8) { result = new Point2D.Double(x0, y1); } else if (anchor == ItemLabelAnchor.OUTSIDE9) { result = new Point2D.Double(x0, y3); } else if (anchor == ItemLabelAnchor.OUTSIDE10) { result = new Point2D.Double(x0, y5); } else if (anchor == ItemLabelAnchor.OUTSIDE11) { result = new Point2D.Double(x1, y6); } else if (anchor == ItemLabelAnchor.OUTSIDE12) { result = new Point2D.Double(x3, y6); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBarRenderer.java
Method name: `Point2D calculateLabelAnchorPoint(ItemLabelAnchor, Rectangle2D, PlotOrientation)` |  | Method name: `Point2D calculateLabelAnchorPoint(ItemLabelAnchor, Rectangle2D, PlotOrientation)`
Number of AST nodes: 16 |  | Number of AST nodes: 16

1

    if (anchor == ItemLabelAnchor.OUTSIDE5) {↵

1

    if (anchor == ItemLabelAnchor.OUTSIDE5) {↵

2

                result = new Point2D.Double(x5, y0);↵

2

                result = new Point2D.Double(x5, y0);↵

3

            }↵

3

            }↵

4

            else if (anchor == ItemLabelAnchor.OUTSIDE6) {↵

4

            else if (anchor == ItemLabelAnchor.OUTSIDE6) {↵

5

                result = new Point2D.Double(x3, y0);↵

5

                result = new Point2D.Double(x3, y0);↵

6

            }↵

6

            }↵

7

            else if (anchor == ItemLabelAnchor.OUTSIDE7) {↵

7

            else if (anchor == ItemLabelAnchor.OUTSIDE7) {↵

8

                result = new Point2D.Double(x1, y0);↵

8

                result = new Point2D.Double(x1, y0);↵

9

            }↵

9

            }↵

10

            else if (anchor == ItemLabelAnchor.OUTSIDE8) {↵

10

            else if (anchor == ItemLabelAnchor.OUTSIDE8) {↵

11

                result = new Point2D.Double(x0, y1);↵

11

                result = new Point2D.Double(x0, y1);↵

12

            }↵

12

            }↵

13

            else if (anchor == ItemLabelAnchor.OUTSIDE9) {↵

13

            else if (anchor == ItemLabelAnchor.OUTSIDE9) {↵

14

                result = new Point2D.Double(x0, y3);↵

14

                result = new Point2D.Double(x0, y3);↵

15

            }↵

15

            }↵

16

            else if (anchor == ItemLabelAnchor.OUTSIDE10) {↵

16

            else if (anchor == ItemLabelAnchor.OUTSIDE10) {↵

17

                result = new Point2D.Double(x0, y5);↵

17

                result = new Point2D.Double(x0, y5);↵

18

            }↵

18

            }↵

19

            else if (anchor == ItemLabelAnchor.OUTSIDE11) {↵

19

            else if (anchor == ItemLabelAnchor.OUTSIDE11) {↵

20

                result = new Point2D.Double(x1, y6);↵

20

                result = new Point2D.Double(x1, y6);↵

21

            }↵

21

            }↵

22

            else if (anchor == ItemLabelAnchor.OUTSIDE12) {↵

22

            else if (anchor == ItemLabelAnchor.OUTSIDE12) {↵

23

                result = new Point2D.Double(x3, y6);↵

23

                result = new Point2D.Double(x3, y6);↵

24

            }

24

            }

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) | 4.8
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 172

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 16
   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) | 5.4
   Clone type | Type 1

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

   51

       else if (anchor == ItemLabelAnchor.OUTSIDE5)

   51

       else if (anchor == ItemLabelAnchor.OUTSIDE5)

   52

       result = new Point2D.Double(x5, y0);

   52

       result = new Point2D.Double(x5, y0);

   53

       else if (anchor == ItemLabelAnchor.OUTSIDE6)

   53

       else if (anchor == ItemLabelAnchor.OUTSIDE6)

   54

       result = new Point2D.Double(x3, y0);

   54

       result = new Point2D.Double(x3, y0);

   55

       else if (anchor == ItemLabelAnchor.OUTSIDE7)

   55

       else if (anchor == ItemLabelAnchor.OUTSIDE7)

   56

       result = new Point2D.Double(x1, y0);

   56

       result = new Point2D.Double(x1, y0);

   57

       else if (anchor == ItemLabelAnchor.OUTSIDE8)

   57

       else if (anchor == ItemLabelAnchor.OUTSIDE8)

   58

       result = new Point2D.Double(x0, y1);

   58

       result = new Point2D.Double(x0, y1);

   59

       else if (anchor == ItemLabelAnchor.OUTSIDE9)

   59

       else if (anchor == ItemLabelAnchor.OUTSIDE9)

   60

       result = new Point2D.Double(x0, y3);

   60

       result = new Point2D.Double(x0, y3);

   61

       else if (anchor == ItemLabelAnchor.OUTSIDE10)

   61

       else if (anchor == ItemLabelAnchor.OUTSIDE10)

   62

       result = new Point2D.Double(x0, y5);

   62

       result = new Point2D.Double(x0, y5);

   63

       else if (anchor == ItemLabelAnchor.OUTSIDE11)

   63

       else if (anchor == ItemLabelAnchor.OUTSIDE11)

   64

       result = new Point2D.Double(x1, y6);

   64

       result = new Point2D.Double(x1, y6);

   65

       else if (anchor == ItemLabelAnchor.OUTSIDE12)

   65

       else if (anchor == ItemLabelAnchor.OUTSIDE12)

   66

       result = new Point2D.Double(x3, y6);

   66

       result = new Point2D.Double(x3, y6);

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