1084-1-2

if (isDomainGridlinesVisible()) { Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { ValueTick tick = (ValueTick) iterator.next(); double v = this.domainAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.BOTTOM); Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); g2.setPaint(getDomainGridlinePaint()); g2.setStroke(getDomainGridlineStroke()); g2.draw(line); } }
if (isRangeGridlinesVisible()) { Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { ValueTick tick = (ValueTick) iterator.next(); double v = this.rangeAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.LEFT); Line2D line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); g2.setPaint(getRangeGridlinePaint()); g2.setStroke(getRangeGridlineStroke()); g2.draw(line); } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java
Method name: `void drawDomainGridlines(Graphics2D, Rectangle2D, List)` |  | Method name: `void drawRangeGridlines(Graphics2D, Rectangle2D, List)`
Number of AST nodes: 9 |  | Number of AST nodes: 9

1

    if (isDomainGridlinesVisible()) {↵

1

    if (isRangeGridlinesVisible()) {↵

2

                Iterator iterator = ticks.iterator();↵

2

                Iterator iterator = ticks.iterator();↵

3

                while (iterator.hasNext()) {↵

3

                while (iterator.hasNext()) {↵

4

                    ValueTick tick = (ValueTick) iterator.next();↵

4

                    ValueTick tick = (ValueTick) iterator.next();↵

5

                    double v = this.domainAxis.valueToJava2D(tick.getValue(), ↵

5

                    double v = this.rangeAxis.valueToJava2D(tick.getValue(), ↵

6

                            dataArea, RectangleEdge.BOTTOM);↵

6

                            dataArea, RectangleEdge.LEFT);↵

7

                    Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, ↵

7

                    Line2D line = new Line2D.Double(dataArea.getMinX(), v, ↵

8

                            dataArea.getMaxY());↵

8

                            dataArea.getMaxX(), v);↵

9

                    g2.setPaint(getDomainGridlinePaint());↵

9

                    g2.setPaint(getRangeGridlinePaint());↵

10

                    g2.setStroke(getDomainGridlineStroke());↵

10

                    g2.setStroke(getRangeGridlineStroke());↵

11

                    g2.draw(line);                ↵

11

                    g2.draw(line);                ↵

12

                }↵

12

                }↵

13

            }

13

            }

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 declared in the same class
Number of node comparisons | 53

1. {Non-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) | 10.2
   Clone type | Type 2

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

   1

       if (isDomainGridlinesVisible())

   1 | if (isDomainGridlinesVisible())
   1 | if (isRangeGridlinesVisible())

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   isDomainGridlinesVisible | isRangeGridlinesVisible | METHOD_INVOCATION_NAME_MISMATCH

   1

       if (isRangeGridlinesVisible())

   2

       Iterator iterator = ticks.iterator();

   2

       Iterator iterator = ticks.iterator();

   3

       while (iterator.hasNext())

   3

       while (iterator.hasNext())

   4

       ValueTick tick = (ValueTick)iterator.next();

   4

       ValueTick tick = (ValueTick)iterator.next();

   5

       double v = this.domainAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.BOTTOM);

   5 | double v = this.domainAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.BOTTOM);
   5 | double v = this.rangeAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.LEFT);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   BOTTOM | LEFT | VARIABLE_NAME_MISMATCH
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   5

       double v = this.rangeAxis.valueToJava2D(tick.getValue(), dataArea, RectangleEdge.LEFT);

   6

       Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());

   6 | Line2D line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());
   6 | Line2D line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   v | dataArea.getMinX() | TYPE_COMPATIBLE_REPLACEMENT
   dataArea.getMinY() | v | TYPE_COMPATIBLE_REPLACEMENT
   v | dataArea.getMaxX() | TYPE_COMPATIBLE_REPLACEMENT
   dataArea.getMaxY() | v | TYPE_COMPATIBLE_REPLACEMENT

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

   6

       Line2D line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);

   7

       g2.setPaint(getDomainGridlinePaint());

   7 | g2.setPaint(getDomainGridlinePaint());
   7 | g2.setPaint(getRangeGridlinePaint());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getDomainGridlinePaint | getRangeGridlinePaint | METHOD_INVOCATION_NAME_MISMATCH

   7

       g2.setPaint(getRangeGridlinePaint());

   8

       g2.setStroke(getDomainGridlineStroke());

   8 | g2.setStroke(getDomainGridlineStroke());
   8 | g2.setStroke(getRangeGridlineStroke());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getDomainGridlineStroke | getRangeGridlineStroke | METHOD_INVOCATION_NAME_MISMATCH

   8

       g2.setStroke(getRangeGridlineStroke());

   9

       g2.draw(line);

   9

       g2.draw(line);

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