263-1-2

if (y0 >= 0.0) { double yleft = (y0 + y1) / 2.0 + stackLeft[1]; float transYLeft = (float) rangeAxis.valueToJava2D(yleft, dataArea, edge1); if (orientation == PlotOrientation.VERTICAL) { left.moveTo(transX1, transY1); left.lineTo(transX1, transStack1); left.lineTo(transXLeft, transStackLeft); left.lineTo(transXLeft, transYLeft); } else { left.moveTo(transY1, transX1); left.lineTo(transStack1, transX1); left.lineTo(transStackLeft, transXLeft); left.lineTo(transYLeft, transXLeft); } left.closePath(); } else { if (orientation == PlotOrientation.VERTICAL) { left.moveTo(transX1, transStack1); left.lineTo(transX1, transY1); left.lineTo(transXLeft, transStackLeft); } else { left.moveTo(transStack1, transX1); left.lineTo(transY1, transX1); left.lineTo(transStackLeft, transXLeft); } left.closePath(); }
if (y2 >= 0.0) { double yright = (y1 + y2) / 2.0 + stackRight[1]; float transYRight = (float) rangeAxis.valueToJava2D(yright, dataArea, edge1); 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); } right.closePath(); } else { 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(); }

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: 21 |  | Number of AST nodes: 21

1

    if (y0 >= 0.0) {↵

1

    if (y2 >= 0.0) {↵

2

                    double yleft = (y0 + y1) / 2.0 + stackLeft[1];↵

2

                    double yright = (y1 + y2) / 2.0 + stackRight[1];↵

3

                    float transYLeft↵

3

                    float transYRight↵

4

                        = (float) rangeAxis.valueToJava2D(yleft, dataArea, edge1);↵

4

                        = (float) rangeAxis.valueToJava2D(yright, dataArea, edge1);↵

5

                    if (orientation == PlotOrientation.VERTICAL) {↵

5

                    if (orientation == PlotOrientation.VERTICAL) {↵

6

                        left.moveTo(transX1, transY1);↵

6

                        right.moveTo(transX1, transStack1);↵

7

                        left.lineTo(transX1, transStack1);↵

7

                        right.lineTo(transX1, transY1);↵

8

                        left.lineTo(transXLeft, transStackLeft);↵

8

                        right.lineTo(transXRight, transYRight);↵

9

                        left.lineTo(transXLeft, transYLeft);↵

9

                        right.lineTo(transXRight, transStackRight);↵

10

                    }↵

10

                    }↵

11

                    else {↵

11

                    else {↵

12

                    	left.moveTo(transY1, transX1);↵

12

                        right.moveTo(transStack1, transX1);↵

13

                    	left.lineTo(transStack1, transX1);↵

13

                        right.lineTo(transY1, transX1);↵

14

                    	left.lineTo(transStackLeft, transXLeft);↵

14

                        right.lineTo(transYRight, transXRight);↵

15

                    	left.lineTo(transYLeft, transXLeft);↵

15

                        right.lineTo(transStackRight, transXRight);↵

16

                    }↵

16

                    }↵

17

                    left.closePath();↵

17

                    right.closePath();↵

18

                }↵

18

                }↵

19

                else {↵

19

                else {↵

20

                	if (orientation == PlotOrientation.VERTICAL) {↵

20

                	if (orientation == PlotOrientation.VERTICAL) {↵

21

                        left.moveTo(transX1, transStack1);↵

21

                        right.moveTo(transX1, transStack1);↵

22

                        left.lineTo(transX1, transY1);↵

22

                        right.lineTo(transX1, transY1);↵

23

                        left.lineTo(transXLeft, transStackLeft);↵

23

                        right.lineTo(transXRight, transStackRight);↵

24

                	}↵

24

                	}↵

25

                	else {↵

25

                	else {↵

26

                        left.moveTo(transStack1, transX1);↵

26

                        right.moveTo(transStack1, transX1);↵

27

                        left.lineTo(transY1, transX1);↵

27

                        right.lineTo(transY1, transX1);↵

28

                        left.lineTo(transStackLeft, transXLeft);↵

28

                        right.lineTo(transStackRight, transXRight);↵

29

                	}↵

29

                	}↵

30

                    left.closePath();↵

30

                    right.closePath();↵

31

                }

31

                }

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

1. {Non-refactorable}

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

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

   45

       if (y0 >= 0.0)

   45 | if (y0 >= 0.0)
   67 | if (y2 >= 0.0)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   y0 | y2 | VARIABLE_NAME_MISMATCH

   67

       if (y2 >= 0.0)

   46

       double yleft = (y0 + y1) / 2.0 + stackLeft[1];

   46 | double yleft = (y0 + y1) / 2.0 + stackLeft[1];
   68 | double yright = (y1 + y2) / 2.0 + stackRight[1];

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   yleft | yright | VARIABLE_NAME_MISMATCH
   y0 | y1 | VARIABLE_NAME_MISMATCH
   y1 | y2 | VARIABLE_NAME_MISMATCH
   stackLeft | stackRight | VARIABLE_NAME_MISMATCH

   68

       double yright = (y1 + y2) / 2.0 + stackRight[1];

   47

       float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);

   47 | float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
   69 | float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transYLeft | transYRight | VARIABLE_NAME_MISMATCH
   yleft | yright | VARIABLE_NAME_MISMATCH

   69

       float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);

   48

       if (orientation == PlotOrientation.VERTICAL)

   70

       if (orientation == PlotOrientation.VERTICAL)

   49

       left.moveTo(transX1, transY1);

   49 | left.moveTo(transX1, transY1);
   71 | right.moveTo(transX1, transStack1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transY1 | transStack1 | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   71

       right.moveTo(transX1, transStack1);

   50

       left.lineTo(transX1, transStack1);

   50 | left.lineTo(transX1, transStack1);
   72 | right.lineTo(transX1, transY1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transStack1 | transY1 | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   72

       right.lineTo(transX1, transY1);

   51

       left.lineTo(transXLeft, transStackLeft);

   51 | left.lineTo(transXLeft, transStackLeft);
   73 | right.lineTo(transXRight, transYRight);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transXLeft | transXRight | VARIABLE_NAME_MISMATCH
   transStackLeft | transYRight | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted

   73

       right.lineTo(transXRight, transYRight);

   52

       left.lineTo(transXLeft, transYLeft);

   52 | left.lineTo(transXLeft, transYLeft);
   74 | right.lineTo(transXRight, transStackRight);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transXLeft | transXRight | VARIABLE_NAME_MISMATCH
   transYLeft | transStackRight | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted

   74

       right.lineTo(transXRight, transStackRight);

       else

       else

   53

       left.moveTo(transY1, transX1);

   53 | left.moveTo(transY1, transX1);
   75 | right.moveTo(transStack1, transX1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transY1 | transStack1 | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   75

       right.moveTo(transStack1, transX1);

   54

       left.lineTo(transStack1, transX1);

   54 | left.lineTo(transStack1, transX1);
   76 | right.lineTo(transY1, transX1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transStack1 | transY1 | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   76

       right.lineTo(transY1, transX1);

   55

       left.lineTo(transStackLeft, transXLeft);

   55 | left.lineTo(transStackLeft, transXLeft);
   77 | right.lineTo(transYRight, transXRight);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transStackLeft | transYRight | VARIABLE_NAME_MISMATCH
   transXLeft | transXRight | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted

   77

       right.lineTo(transYRight, transXRight);

   56

       left.lineTo(transYLeft, transXLeft);

   56 | left.lineTo(transYLeft, transXLeft);
   78 | right.lineTo(transStackRight, transXRight);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transYLeft | transStackRight | VARIABLE_NAME_MISMATCH
   transXLeft | transXRight | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted

   78

       right.lineTo(transStackRight, transXRight);

   57

       left.closePath();

   57 | left.closePath();
   79 | right.closePath();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   left | right | VARIABLE_NAME_MISMATCH

   79

       right.closePath();

       else

       else

   58

       if (orientation == PlotOrientation.VERTICAL)

   80

       if (orientation == PlotOrientation.VERTICAL)

   59

       left.moveTo(transX1, transStack1);

   59 | left.moveTo(transX1, transStack1);
   81 | right.moveTo(transX1, transStack1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   left | right | VARIABLE_NAME_MISMATCH

   81

       right.moveTo(transX1, transStack1);

   60

       left.lineTo(transX1, transY1);

   60 | left.lineTo(transX1, transY1);
   82 | right.lineTo(transX1, transY1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   left | right | VARIABLE_NAME_MISMATCH

   82

       right.lineTo(transX1, transY1);

   61

       left.lineTo(transXLeft, transStackLeft);

   61 | left.lineTo(transXLeft, transStackLeft);
   83 | right.lineTo(transXRight, transStackRight);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transXLeft | transXRight | VARIABLE_NAME_MISMATCH
   transStackLeft | transStackRight | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   83

       right.lineTo(transXRight, transStackRight);

       else

       else

   62

       left.moveTo(transStack1, transX1);

   62 | left.moveTo(transStack1, transX1);
   84 | right.moveTo(transStack1, transX1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   left | right | VARIABLE_NAME_MISMATCH

   84

       right.moveTo(transStack1, transX1);

   63

       left.lineTo(transY1, transX1);

   63 | left.lineTo(transY1, transX1);
   85 | right.lineTo(transY1, transX1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   left | right | VARIABLE_NAME_MISMATCH

   85

       right.lineTo(transY1, transX1);

   64

       left.lineTo(transStackLeft, transXLeft);

   64 | left.lineTo(transStackLeft, transXLeft);
   86 | right.lineTo(transStackRight, transXRight);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   transStackLeft | transStackRight | VARIABLE_NAME_MISMATCH
   transXLeft | transXRight | VARIABLE_NAME_MISMATCH
   left | right | VARIABLE_NAME_MISMATCH

   86

       right.lineTo(transStackRight, transXRight);

   65

       left.closePath();

   65 | left.closePath();
   87 | right.closePath();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   left | right | VARIABLE_NAME_MISMATCH

   87

       right.closePath();

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted