1623-1-2

XYItemRenderer r = getRenderer(i); if (r != null) { ValueAxis domainAxis = getDomainAxisForDataset(i); ValueAxis rangeAxis = getRangeAxisForDataset(i); r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, Layer.BACKGROUND, info); }
XYItemRenderer r = getRenderer(i); if (r != null) { ValueAxis domainAxis = getDomainAxisForDataset(i); ValueAxis rangeAxis = getRangeAxisForDataset(i); r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, Layer.FOREGROUND, info); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)` |  | Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    XYItemRenderer r = getRenderer(i);↵

1

    XYItemRenderer r = getRenderer(i);↵

2

                    if (r != null) {↵

2

                    if (r != null) {↵

3

                        ValueAxis domainAxis = getDomainAxisForDataset(i);↵

3

                        ValueAxis domainAxis = getDomainAxisForDataset(i);↵

4

                        ValueAxis rangeAxis = getRangeAxisForDataset(i);↵

4

                        ValueAxis rangeAxis = getRangeAxisForDataset(i);↵

5

                        r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis,↵

5

                        r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis,↵

6

                                Layer.BACKGROUND, info);↵

6

                                Layer.FOREGROUND, info);↵

7

                    }

7

                    }

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

1. {Refactorable}

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

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

   72

       XYItemRenderer r = getRenderer(i);

   80

       XYItemRenderer r = getRenderer(i);

   73

       if (r != null)

   81

       if (r != null)

   74

       ValueAxis domainAxis = getDomainAxisForDataset(i);

   82

       ValueAxis domainAxis = getDomainAxisForDataset(i);

   75

       ValueAxis rangeAxis = getRangeAxisForDataset(i);

   83

       ValueAxis rangeAxis = getRangeAxisForDataset(i);

   76

       r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, Layer.BACKGROUND, info);

   76 | r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, Layer.BACKGROUND, info);
   84 | r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, Layer.FOREGROUND, info);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   BACKGROUND | FOREGROUND | VARIABLE_NAME_MISMATCH

   84

       r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, Layer.FOREGROUND, info);

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