1091-2-4

if (orientation == PlotOrientation.VERTICAL) { right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transYRight); right.lineTo(transXRight, transStackRight); } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transYRight, transXRight); right.lineTo(transStackRight, transXRight); }
if (orientation == PlotOrientation.VERTICAL) { right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transYRight); right.lineTo(transXRight, transStackRight); } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transYRight, transXRight); right.lineTo(transStackRight, transXRight); }

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

1

    if (orientation == PlotOrientation.VERTICAL) {↵

1

    if (orientation == PlotOrientation.VERTICAL) {↵

2

                        right.moveTo(transX1, transStack1);↵

2

                        right.moveTo(transX1, transStack1);↵

3

                        right.lineTo(transX1, transY1);↵

3

                        right.lineTo(transX1, transY1);↵

4

                        right.lineTo(transXRight, transYRight);↵

4

                        right.lineTo(transXRight, transYRight);↵

5

                        right.lineTo(transXRight, transStackRight);↵

5

                        right.lineTo(transXRight, transStackRight);↵

6

                    }↵

6

                    }↵

7

                    else {↵

7

                    else {↵

8

                        right.moveTo(transStack1, transX1);↵

8

                        right.moveTo(transStack1, transX1);↵

9

                        right.lineTo(transY1, transX1);↵

9

                        right.lineTo(transY1, transX1);↵

10

                        right.lineTo(transYRight, transXRight);↵

10

                        right.lineTo(transYRight, transXRight);↵

11

                        right.lineTo(transStackRight, transXRight);↵

11

                        right.lineTo(transStackRight, transXRight);↵

12

                    }

12

                    }

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.1
Clones location | Clones are in the same method
Number of node comparisons | 81

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 9
   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) | 7.7
   Clone type | Type 1

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

   70

       if (orientation == PlotOrientation.VERTICAL)

   124

       if (orientation == PlotOrientation.VERTICAL)

   71

       right.moveTo(transX1, transStack1);

   125

       right.moveTo(transX1, transStack1);

   72

       right.lineTo(transX1, transY1);

   126

       right.lineTo(transX1, transY1);

   73

       right.lineTo(transXRight, transYRight);

   127

       right.lineTo(transXRight, transYRight);

   74

       right.lineTo(transXRight, transStackRight);

   128

       right.lineTo(transXRight, transStackRight);

       else

       else

   75

       right.moveTo(transStack1, transX1);

   129

       right.moveTo(transStack1, transX1);

   76

       right.lineTo(transY1, transX1);

   130

       right.lineTo(transY1, transX1);

   77

       right.lineTo(transYRight, transXRight);

   131

       right.lineTo(transYRight, transXRight);

   78

       right.lineTo(transStackRight, transXRight);

   132

       right.lineTo(transStackRight, transXRight);

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