386-4-5

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

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

1

    anchor = TextAnchor.CENTER_RIGHT;↵

1

    anchor = TextAnchor.CENTER_RIGHT;↵

2

                        rotationAnchor = TextAnchor.CENTER_RIGHT;↵

2

                        rotationAnchor = TextAnchor.CENTER_RIGHT;↵

3

                        if (edge == RectangleEdge.TOP) {↵

3

                        if (edge == RectangleEdge.TOP) {↵

4

                            angle = Math.PI / 2.0;↵

4

                            angle = Math.PI / 2.0;↵

5

                        }↵

5

                        }↵

6

                        else {↵

6

                        else {↵

7

                            angle = -Math.PI / 2.0;↵

7

                            angle = -Math.PI / 2.0;↵

8

                        }

8

                        }

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

1. {Non-refactorable}

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

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

   20

       anchor = TextAnchor.CENTER_RIGHT;

   21

       anchor = TextAnchor.CENTER_RIGHT;

   21

       rotationAnchor = TextAnchor.CENTER_RIGHT;

   22

       rotationAnchor = TextAnchor.CENTER_RIGHT;

   22

       if (edge == RectangleEdge.TOP)

   23

       if (edge == RectangleEdge.TOP)

   23

       angle = Math.PI / 2.0;

   24

       angle = Math.PI / 2.0;

       else

       else

   24

       angle = -Math.PI / 2.0;

   25

       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