317-1-2

if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = -Math.PI / 2.0; } else { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = Math.PI / 2.0; }
if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = -Math.PI / 2.0; } else { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = Math.PI / 2.0; }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/LogarithmicAxis.java
Method name: `List refreshTicksVertical(Graphics2D, Rectangle2D, RectangleEdge)` |  | Method name: `List refreshTicksVertical(Graphics2D, Rectangle2D, RectangleEdge)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (edge == RectangleEdge.LEFT) {↵

1

    if (edge == RectangleEdge.LEFT) {↵

2

                            anchor = TextAnchor.BOTTOM_CENTER;↵

2

                                anchor = TextAnchor.BOTTOM_CENTER;↵

3

                            rotationAnchor = TextAnchor.BOTTOM_CENTER;↵

3

                                rotationAnchor = TextAnchor.BOTTOM_CENTER;↵

4

                            angle = -Math.PI / 2.0;↵

4

                                angle = -Math.PI / 2.0;↵

5

                        }↵

5

                            }↵

6

                        else {↵

6

                            else {↵

7

                            anchor = TextAnchor.BOTTOM_CENTER;↵

7

                                anchor = TextAnchor.BOTTOM_CENTER;↵

8

                            rotationAnchor = TextAnchor.BOTTOM_CENTER;↵

8

                                rotationAnchor = TextAnchor.BOTTOM_CENTER;↵

9

                            angle = Math.PI / 2.0;↵

9

                                angle = Math.PI / 2.0;↵

10

                        }

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

1. {Non-refactorable}

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

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

   22

       if (edge == RectangleEdge.LEFT)

   61

       if (edge == RectangleEdge.LEFT)

   23

       anchor = TextAnchor.BOTTOM_CENTER;

   62

       anchor = TextAnchor.BOTTOM_CENTER;

   24

       rotationAnchor = TextAnchor.BOTTOM_CENTER;

   63

       rotationAnchor = TextAnchor.BOTTOM_CENTER;

   25

       angle = -Math.PI / 2.0;

   64

       angle = -Math.PI / 2.0;

       else

       else

   26

       anchor = TextAnchor.BOTTOM_CENTER;

   65

       anchor = TextAnchor.BOTTOM_CENTER;

   27

       rotationAnchor = TextAnchor.BOTTOM_CENTER;

   66

       rotationAnchor = TextAnchor.BOTTOM_CENTER;

   28

       angle = Math.PI / 2.0;

   67

       angle = Math.PI / 2.0;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables anchor, rotationAnchor, angle , while Clone fragment #2 returns variables anchor, rotationAnchor, angle