387-6-7

if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.CENTER_RIGHT; rotationAnchor = TextAnchor.CENTER_RIGHT; } else { anchor = TextAnchor.CENTER_LEFT; rotationAnchor = TextAnchor.CENTER_LEFT; }
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/NumberAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java
Method name: `List refreshTicksVertical(Graphics2D, Rectangle2D, RectangleEdge)` |  | Method name: `List refreshTicksHorizontal(Graphics2D, Rectangle2D, RectangleEdge)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (edge == RectangleEdge.LEFT) {↵

1

    if (edge == RectangleEdge.TOP) {↵

2

                            anchor = TextAnchor.CENTER_RIGHT;↵

2

                            anchor = TextAnchor.BOTTOM_CENTER;↵

3

                            rotationAnchor = TextAnchor.CENTER_RIGHT;↵

3

                            rotationAnchor = TextAnchor.BOTTOM_CENTER;↵

4

                        }↵

4

                        }↵

5

                        else {↵

5

                        else {↵

6

                            anchor = TextAnchor.CENTER_LEFT;↵

6

                            anchor = TextAnchor.TOP_CENTER;↵

7

                            rotationAnchor = TextAnchor.CENTER_LEFT;↵

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.4
Clones location | Clones are declared in the same 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.5
   Clone type | Type 2

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

   29

       if (edge == RectangleEdge.LEFT)

   29 | if (edge == RectangleEdge.LEFT)
   26 | if (edge == RectangleEdge.TOP)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   LEFT | TOP | VARIABLE_NAME_MISMATCH

   26

       if (edge == RectangleEdge.TOP)

   30

       anchor = TextAnchor.CENTER_RIGHT;

   30 | anchor = TextAnchor.CENTER_RIGHT;
   27 | anchor = TextAnchor.BOTTOM_CENTER;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CENTER_RIGHT | BOTTOM_CENTER | VARIABLE_NAME_MISMATCH

   27

       anchor = TextAnchor.BOTTOM_CENTER;

   31

       rotationAnchor = TextAnchor.CENTER_RIGHT;

   31 | rotationAnchor = TextAnchor.CENTER_RIGHT;
   28 | rotationAnchor = TextAnchor.BOTTOM_CENTER;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CENTER_RIGHT | BOTTOM_CENTER | VARIABLE_NAME_MISMATCH

   28

       rotationAnchor = TextAnchor.BOTTOM_CENTER;

       else

       else

   32

       anchor = TextAnchor.CENTER_LEFT;

   32 | anchor = TextAnchor.CENTER_LEFT;
   29 | anchor = TextAnchor.TOP_CENTER;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CENTER_LEFT | TOP_CENTER | VARIABLE_NAME_MISMATCH

   29

       anchor = TextAnchor.TOP_CENTER;

   33

       rotationAnchor = TextAnchor.CENTER_LEFT;

   33 | rotationAnchor = TextAnchor.CENTER_LEFT;
   30 | rotationAnchor = TextAnchor.TOP_CENTER;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CENTER_LEFT | TOP_CENTER | VARIABLE_NAME_MISMATCH

   30

       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