1108-2-4

if (orientation == PlotOrientation.VERTICAL) { right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transStackRight); } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transStackRight, transXRight); } right.closePath();
if (orientation == PlotOrientation.VERTICAL) { right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transStackRight); } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); 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: 8 |  | Number of AST nodes: 7

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, transStackRight);↵

4

                        right.lineTo(transXRight, transStackRight);↵

5

                	}↵

5

                	}↵

6

                	else {↵

6

                	else {↵

7

                        right.moveTo(transStack1, transX1);↵

7

                        right.moveTo(transStack1, transX1);↵

8

                        right.lineTo(transY1, transX1);↵

8

                        right.lineTo(transY1, transX1);↵

9

                        right.lineTo(transStackRight, transXRight);↵

9

                        right.lineTo(transStackRight, transXRight);↵

10

                	}↵

10

                	}

11

                    right.closePath();

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 4.8
   Clone type | Type 3

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

   80

       if (orientation == PlotOrientation.VERTICAL)

   114

       if (orientation == PlotOrientation.VERTICAL)

   81

       right.moveTo(transX1, transStack1);

   115

       right.moveTo(transX1, transStack1);

   82

       right.lineTo(transX1, transY1);

   116

       right.lineTo(transX1, transY1);

   83

       right.lineTo(transXRight, transStackRight);

   117

       right.lineTo(transXRight, transStackRight);

       else

       else

   84

       right.moveTo(transStack1, transX1);

   118

       right.moveTo(transStack1, transX1);

   85

       right.lineTo(transY1, transX1);

   119

       right.lineTo(transY1, transX1);

   86

       right.lineTo(transStackRight, transXRight);

   120

       right.lineTo(transStackRight, transXRight);

   87

       right.closePath();

   87 | right.closePath();

   Preondition Violations
   Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted