1492-4-5

if (RectangleEdge.isTopOrBottom(edge)) { min = area.getX(); max = area.getMaxX(); } else if (RectangleEdge.isLeftOrRight(edge)) { max = area.getMinY(); min = area.getMaxY(); }
if (RectangleEdge.isTopOrBottom(edge)) { min = area.getX(); max = area.getMaxX(); } else if (RectangleEdge.isLeftOrRight(edge)) { min = area.getMaxY(); max = area.getY(); }

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: `double valueToJava2D(double, Rectangle2D, RectangleEdge)` |  | Method name: `double java2DToValue(double, Rectangle2D, RectangleEdge)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (RectangleEdge.isTopOrBottom(edge)) {↵

1

    if (RectangleEdge.isTopOrBottom(edge)) {↵

2

                min = area.getX();↵

2

                min = area.getX();↵

3

                max = area.getMaxX();↵

3

                max = area.getMaxX();↵

4

            }↵

4

            }↵

5

            else if (RectangleEdge.isLeftOrRight(edge)) {↵

5

            else if (RectangleEdge.isLeftOrRight(edge)) {↵

6

                max = area.getMinY();↵

6

                min = area.getMaxY();↵

7

                min = area.getMaxY();↵

7

                max = area.getY();↵

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 declared in the same class
Number of node comparisons | 28

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   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
   --- | --- | --- | --- | ---

   6

       if (RectangleEdge.isTopOrBottom(edge))

   6

       if (RectangleEdge.isTopOrBottom(edge))

   7

       min = area.getX();

   7

       min = area.getX();

   8

       max = area.getMaxX();

   8

       max = area.getMaxX();

   9

       else if (RectangleEdge.isLeftOrRight(edge))

   9

       else if (RectangleEdge.isLeftOrRight(edge))

   10

       max = area.getMinY();

   10 | max = area.getMinY();
   11 | max = area.getY();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getMinY | getY | METHOD_INVOCATION_NAME_MISMATCH

   11

       max = area.getY();

   11

       min = area.getMaxY();

   10

       min = area.getMaxY();

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