387-1-3

if (edge == RectangleEdge.TOP) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; } else { anchor = TextAnchor.TOP_CENTER; rotationAnchor = TextAnchor.TOP_CENTER; }
if (edge == RectangleEdge.TOP) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; } else { anchor = TextAnchor.TOP_CENTER; rotationAnchor = TextAnchor.TOP_CENTER; }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SymbolAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.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

    if (edge == RectangleEdge.TOP) {↵

1

    if (edge == RectangleEdge.TOP) {↵

2

                            anchor = TextAnchor.BOTTOM_CENTER;↵

2

                            anchor = TextAnchor.BOTTOM_CENTER;↵

3

                            rotationAnchor = TextAnchor.BOTTOM_CENTER;↵

3

                            rotationAnchor = TextAnchor.BOTTOM_CENTER;↵

4

                        }↵

4

                        }↵

5

                        else {↵

5

                        else {↵

6

                            anchor = TextAnchor.TOP_CENTER;↵

6

                            anchor = TextAnchor.TOP_CENTER;↵

7

                            rotationAnchor = TextAnchor.TOP_CENTER;↵

7

                            rotationAnchor = TextAnchor.TOP_CENTER;↵

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

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.3
   Clone type | Type 1

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

   38

       if (edge == RectangleEdge.TOP)

   25

       if (edge == RectangleEdge.TOP)

   39

       anchor = TextAnchor.BOTTOM_CENTER;

   26

       anchor = TextAnchor.BOTTOM_CENTER;

   40

       rotationAnchor = TextAnchor.BOTTOM_CENTER;

   27

       rotationAnchor = TextAnchor.BOTTOM_CENTER;

       else

       else

   41

       anchor = TextAnchor.TOP_CENTER;

   28

       anchor = TextAnchor.TOP_CENTER;

   42

       rotationAnchor = TextAnchor.TOP_CENTER;

   29

       rotationAnchor = TextAnchor.TOP_CENTER;

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