1489-1-2

if (orient == PlotOrientation.VERTICAL) { x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge()); } else { x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge()); }
if (orient == PlotOrientation.VERTICAL) { y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge()); } else { y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge()); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)` |  | Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (orient == PlotOrientation.VERTICAL) {↵

1

    if (orient == PlotOrientation.VERTICAL) {↵

2

                        x = domainAxis.java2DToValue(anchor.getX(), dataArea,↵

2

                        y = rangeAxis.java2DToValue(anchor.getY(), dataArea,↵

3

                                getDomainAxisEdge());↵

3

                                getRangeAxisEdge());↵

4

                    }↵

4

                    }↵

5

                    else {↵

5

                    else {↵

6

                        x = domainAxis.java2DToValue(anchor.getY(), dataArea,↵

6

                        y = rangeAxis.java2DToValue(anchor.getX(), dataArea,↵

7

                                getDomainAxisEdge());↵

7

                                getRangeAxisEdge());↵

8

                    }

8

                    }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are in the same method
Number of node comparisons | 10

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 3
   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) | 3.4
   Clone type | Type 2

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

   28

       if (orient == PlotOrientation.VERTICAL)

   35

       if (orient == PlotOrientation.VERTICAL)

   29

       x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge());

   29 | x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge());
   36 | y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   x | y | VARIABLE_NAME_MISMATCH
   getX | getY | METHOD_INVOCATION_NAME_MISMATCH
   getDomainAxisEdge | getRangeAxisEdge | METHOD_INVOCATION_NAME_MISMATCH
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   36

       y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());

       else

       else

   30

       x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge());

   30 | x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge());
   37 | y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   x | y | VARIABLE_NAME_MISMATCH
   getY | getX | METHOD_INVOCATION_NAME_MISMATCH
   getDomainAxisEdge | getRangeAxisEdge | METHOD_INVOCATION_NAME_MISMATCH
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   37

       y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());

   Precondition Violations (0)
   Row | Violation
   --- | ---