151-1-2

double l_x = x_domainAxis.valueToJava2D(( (Double) l_xValues[0]).doubleValue(), x_dataArea, l_domainAxisLocation); if (this.roundXCoordinates) { l_x = Math.rint(l_x); } double l_y = x_rangeAxis.valueToJava2D(( (Double) l_yValues[0]).doubleValue(), x_dataArea, l_rangeAxisLocation); l_path.moveTo((float) l_x, (float) l_y); for (int i = 1; i < l_xValues.length; i++) { l_x = x_domainAxis.valueToJava2D(( (Double) l_xValues[i]).doubleValue(), x_dataArea, l_domainAxisLocation); if (this.roundXCoordinates) { l_x = Math.rint(l_x); } l_y = x_rangeAxis.valueToJava2D(( (Double) l_yValues[i]).doubleValue(), x_dataArea, l_rangeAxisLocation); l_path.lineTo((float) l_x, (float) l_y); } l_path.closePath();
double l_x = x_domainAxis.valueToJava2D(( (Double) l_xValues[0]).doubleValue(), x_dataArea, l_domainAxisLocation); if (this.roundXCoordinates) { l_x = Math.rint(l_x); } double l_y = x_rangeAxis.valueToJava2D(( (Double) l_yValues[0]).doubleValue(), x_dataArea, l_rangeAxisLocation); l_path.moveTo((float) l_y, (float) l_x); for (int i = 1; i < l_xValues.length; i++) { l_x = x_domainAxis.valueToJava2D(( (Double) l_xValues[i]).doubleValue(), x_dataArea, l_domainAxisLocation); if (this.roundXCoordinates) { l_x = Math.rint(l_x); } l_y = x_rangeAxis.valueToJava2D(( (Double) l_yValues[i]).doubleValue(), x_dataArea, l_rangeAxisLocation); l_path.lineTo((float) l_y, (float) l_x); } l_path.closePath();

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.java
Method name: `void createPolygon(Graphics2D, Rectangle2D, XYPlot, ValueAxis, ValueAxis, boolean, LinkedList, LinkedList)` |  | Method name: `void createPolygon(Graphics2D, Rectangle2D, XYPlot, ValueAxis, ValueAxis, boolean, LinkedList, LinkedList)`
Number of AST nodes: 12 |  | Number of AST nodes: 12

1

    double l_x = x_domainAxis.valueToJava2D((↵

1

    double l_x = x_domainAxis.valueToJava2D((↵

2

                        (Double) l_xValues[0]).doubleValue(), x_dataArea, ↵

2

                        (Double) l_xValues[0]).doubleValue(), x_dataArea, ↵

3

                        l_domainAxisLocation);↵

3

                        l_domainAxisLocation);↵

4

                if (this.roundXCoordinates) {↵

4

                if (this.roundXCoordinates) {↵

5

                    l_x = Math.rint(l_x);↵

5

                    l_x = Math.rint(l_x);↵

6

                }↵

6

                }↵

7

                double l_y = x_rangeAxis.valueToJava2D((↵

7

                double l_y = x_rangeAxis.valueToJava2D((↵

8

                        (Double) l_yValues[0]).doubleValue(), x_dataArea, ↵

8

                        (Double) l_yValues[0]).doubleValue(), x_dataArea, ↵

9

                        l_rangeAxisLocation);↵

9

                        l_rangeAxisLocation);↵

10

                l_path.moveTo((float) l_x, (float) l_y);↵

10

                l_path.moveTo((float) l_y, (float) l_x);↵

11

                for (int i = 1; i < l_xValues.length; i++) {↵

11

                for (int i = 1; i < l_xValues.length; i++) {↵

12

                    l_x = x_domainAxis.valueToJava2D((↵

12

                    l_x = x_domainAxis.valueToJava2D((↵

13

                            (Double) l_xValues[i]).doubleValue(), x_dataArea, ↵

13

                            (Double) l_xValues[i]).doubleValue(), x_dataArea, ↵

14

                            l_domainAxisLocation);↵

14

                            l_domainAxisLocation);↵

15

                    if (this.roundXCoordinates) {↵

15

                    if (this.roundXCoordinates) {↵

16

                        l_x = Math.rint(l_x);↵

16

                        l_x = Math.rint(l_x);↵

17

                    }↵

17

                    }↵

18

                    l_y = x_rangeAxis.valueToJava2D((↵

18

                    l_y = x_rangeAxis.valueToJava2D((↵

19

                            (Double) l_yValues[i]).doubleValue(), x_dataArea, ↵

19

                            (Double) l_yValues[i]).doubleValue(), x_dataArea, ↵

20

                            l_rangeAxisLocation);↵

20

                            l_rangeAxisLocation);↵

21

                    l_path.lineTo((float) l_x, (float) l_y);↵

21

                    l_path.lineTo((float) l_y, (float) l_x);↵

22

                }↵

22

                }↵

23

                l_path.closePath();

23

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

1. {Non-refactorable}

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

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

   8

       double l_x = x_domainAxis.valueToJava2D(((Double)l_xValues[0]).doubleValue(), x_dataArea, l_domainAxisLocation);

   20

       double l_x = x_domainAxis.valueToJava2D(((Double)l_xValues[0]).doubleValue(), x_dataArea, l_domainAxisLocation);

   9

       if (this.roundXCoordinates)

   21

       if (this.roundXCoordinates)

   10

       l_x = Math.rint(l_x);

   22

       l_x = Math.rint(l_x);

   11

       double l_y = x_rangeAxis.valueToJava2D(((Double)l_yValues[0]).doubleValue(), x_dataArea, l_rangeAxisLocation);

   23

       double l_y = x_rangeAxis.valueToJava2D(((Double)l_yValues[0]).doubleValue(), x_dataArea, l_rangeAxisLocation);

   12

       l_path.moveTo((float)l_x, (float)l_y);

   12 | l_path.moveTo((float)l_x, (float)l_y);
   24 | l_path.moveTo((float)l_y, (float)l_x);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   l_x | l_y | VARIABLE_NAME_MISMATCH
   l_y | l_x | VARIABLE_NAME_MISMATCH

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

   24

       l_path.moveTo((float)l_y, (float)l_x);

   13

       for (int i = 1; i < l_xValues.length; i++)

   25

       for (int i = 1; i < l_xValues.length; i++)

   14

       l_x = x_domainAxis.valueToJava2D(((Double)l_xValues[i]).doubleValue(), x_dataArea, l_domainAxisLocation);

   26

       l_x = x_domainAxis.valueToJava2D(((Double)l_xValues[i]).doubleValue(), x_dataArea, l_domainAxisLocation);

   15

       if (this.roundXCoordinates)

   27

       if (this.roundXCoordinates)

   16

       l_x = Math.rint(l_x);

   28

       l_x = Math.rint(l_x);

   17

       l_y = x_rangeAxis.valueToJava2D(((Double)l_yValues[i]).doubleValue(), x_dataArea, l_rangeAxisLocation);

   29

       l_y = x_rangeAxis.valueToJava2D(((Double)l_yValues[i]).doubleValue(), x_dataArea, l_rangeAxisLocation);

   18

       l_path.lineTo((float)l_x, (float)l_y);

   18 | l_path.lineTo((float)l_x, (float)l_y);
   30 | l_path.lineTo((float)l_y, (float)l_x);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   l_x | l_y | VARIABLE_NAME_MISMATCH
   l_y | l_x | VARIABLE_NAME_MISMATCH

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

   30

       l_path.lineTo((float)l_y, (float)l_x);

   19

       l_path.closePath();

   31

       l_path.closePath();

   Precondition Violations (8)
   Row | Violation
   --- | ---
   1 | Expression l_x cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression l_y cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression l_y cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression l_x cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression l_x cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression l_y cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression l_y cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression l_x cannot be parameterized, because it has dependencies to/from statements that will be extracted