141-1-2

if (anchor == ItemLabelAnchor.INSIDE10) { result = new Point2D.Double(x2, y4); } else if (anchor == ItemLabelAnchor.INSIDE11) { result = new Point2D.Double(x2, y4); } else if (anchor == ItemLabelAnchor.INSIDE12) { result = new Point2D.Double(x3, y4); } else if (anchor == ItemLabelAnchor.OUTSIDE1) { result = new Point2D.Double(x5, y6); } else if (anchor == ItemLabelAnchor.OUTSIDE2) { result = new Point2D.Double(x6, y5); } else if (anchor == ItemLabelAnchor.OUTSIDE3) { result = new Point2D.Double(x6, y3); } else if (anchor == ItemLabelAnchor.OUTSIDE4) { result = new Point2D.Double(x6, y1); } else 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.INSIDE10) { result = new Point2D.Double(x2, y4); } else if (anchor == ItemLabelAnchor.INSIDE11) { result = new Point2D.Double(x2, y4); } else if (anchor == ItemLabelAnchor.INSIDE12) { result = new Point2D.Double(x3, y4); } else if (anchor == ItemLabelAnchor.OUTSIDE1) { result = new Point2D.Double(x5, y6); } else if (anchor == ItemLabelAnchor.OUTSIDE2) { result = new Point2D.Double(x6, y5); } else if (anchor == ItemLabelAnchor.OUTSIDE3) { result = new Point2D.Double(x6, y3); } else if (anchor == ItemLabelAnchor.OUTSIDE4) { result = new Point2D.Double(x6, y1); } else 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: 30 |  | Number of AST nodes: 30

1

    if (anchor == ItemLabelAnchor.INSIDE10) {↵

1

    if (anchor == ItemLabelAnchor.INSIDE10) {↵

2

                result = new Point2D.Double(x2, y4);↵

2

                result = new Point2D.Double(x2, y4);↵

3

            }↵

3

            }↵

4

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

4

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

5

                result = new Point2D.Double(x2, y4);↵

5

                result = new Point2D.Double(x2, y4);↵

6

            }↵

6

            }↵

7

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

7

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

8

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

8

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

9

            }↵

9

            }↵

10

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

10

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

11

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

11

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

12

            }↵

12

            }↵

13

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

13

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

14

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

14

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

15

            }↵

15

            }↵

16

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

16

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

17

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

17

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

18

            }↵

18

            }↵

19

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

19

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

20

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

20

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

21

            }↵

21

            }↵

22

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

22

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

23

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

23

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

24

            }↵

24

            }↵

25

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

25

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

26

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

26

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

27

            }↵

27

            }↵

28

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

28

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

29

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

29

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

30

            }↵

30

            }↵

31

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

31

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

32

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

32

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

33

            }↵

33

            }↵

34

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

34

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

35

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

35

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

36

            }↵

36

            }↵

37

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

37

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

38

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

38

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

39

            }↵

39

            }↵

40

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

40

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

41

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

41

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

42

            }↵

42

            }↵

43

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

43

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

44

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

44

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

45

            }

45

            }

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

1. {Refactorable}

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

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

   37

       else if (anchor == ItemLabelAnchor.INSIDE10)

   37

       else if (anchor == ItemLabelAnchor.INSIDE10)

   38

       result = new Point2D.Double(x2, y4);

   38

       result = new Point2D.Double(x2, y4);

   39

       else if (anchor == ItemLabelAnchor.INSIDE11)

   39

       else if (anchor == ItemLabelAnchor.INSIDE11)

   40

       result = new Point2D.Double(x2, y4);

   40

       result = new Point2D.Double(x2, y4);

   41

       else if (anchor == ItemLabelAnchor.INSIDE12)

   41

       else if (anchor == ItemLabelAnchor.INSIDE12)

   42

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

   42

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

   43

       else if (anchor == ItemLabelAnchor.OUTSIDE1)

   43

       else if (anchor == ItemLabelAnchor.OUTSIDE1)

   44

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

   44

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

   45

       else if (anchor == ItemLabelAnchor.OUTSIDE2)

   45

       else if (anchor == ItemLabelAnchor.OUTSIDE2)

   46

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

   46

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

   47

       else if (anchor == ItemLabelAnchor.OUTSIDE3)

   47

       else if (anchor == ItemLabelAnchor.OUTSIDE3)

   48

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

   48

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

   49

       else if (anchor == ItemLabelAnchor.OUTSIDE4)

   49

       else if (anchor == ItemLabelAnchor.OUTSIDE4)

   50

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

   50

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

   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
   --- | ---