1538-2-4

if (orientation == PlotOrientation.VERTICAL) { areaState.getLine().setLine(transX0, transY0, transX1, transY1); } else if (orientation == PlotOrientation.HORIZONTAL) { areaState.getLine().setLine(transY0, transX0, transY1, transX1); }
if (orientation == PlotOrientation.HORIZONTAL) { state.workingLine.setLine(transY0, transX0, transY1, transX1); } else if (orientation == PlotOrientation.VERTICAL) { state.workingLine.setLine(transX0, transY0, transX1, transY1); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java
Method name: `void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)` |  | Method name: `void drawPrimaryLine(XYItemRendererState, Graphics2D, XYPlot, XYDataset, int, int, int, ValueAxis, ValueAxis, Rectangle2D)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    if (orientation == PlotOrientation.VERTICAL) {↵

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

2

                            areaState.getLine().setLine(transX0, transY0, transX1,↵

2

                state.workingLine.setLine(transY0, transX0, transY1,↵

3

                                    transY1);↵

3

     transX1);↵

4

                        }↵

4

            ↵

5

          ↵

5

    }↵

6

                  else if (orientation == PlotOrientation.HORIZONTAL) {↵

6

            else if (orientation == PlotOrientation.VERTICAL) {↵

7

                            areaState.getLine().setLine(transY0, transX0, transY1,↵

7

                state.workingLine.setLine(transX0, transY0, transX1,↵

8

                                    transX1);↵

8

     transY1);↵

9

                        }

9

            }

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

1. {Refactorable}

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

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

   39

       if (orientation == PlotOrientation.VERTICAL)

   22

       if (orientation == PlotOrientation.VERTICAL)

   40

       areaState.getLine().setLine(transX0, transY0, transX1, transY1);

   40 | areaState.getLine().setLine(transX0, transY0, transX1, transY1);
   23 | state.workingLine.setLine(transX0, transY0, transX1, transY1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   areaState.getLine() | state.workingLine | TYPE_COMPATIBLE_REPLACEMENT

   23

       state.workingLine.setLine(transX0, transY0, transX1, transY1);

   41

       else if (orientation == PlotOrientation.HORIZONTAL)

   20

       else if (orientation == PlotOrientation.HORIZONTAL)

   42

       areaState.getLine().setLine(transY0, transX0, transY1, transX1);

   42 | areaState.getLine().setLine(transY0, transX0, transY1, transX1);
   21 | state.workingLine.setLine(transY0, transX0, transY1, transX1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   areaState.getLine() | state.workingLine | TYPE_COMPATIBLE_REPLACEMENT

   21

       state.workingLine.setLine(transY0, transX0, transY1, transX1);

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