1141-1-2

for (int i = rendererCount - 1; i >= 0; i--) { XYItemRenderer r = getRenderer(i); if (i >= getDatasetCount()) { // we need the dataset to make continue; // a link to the axes } if (r != null) { ValueAxis domainAxis = getDomainAxisForDataset(i); ValueAxis rangeAxis = getRangeAxisForDataset(i); r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis, Layer.BACKGROUND, info); } }
for (int i = rendererCount - 1; i >= 0; i--) { XYItemRenderer r = getRenderer(i); if (i >= getDatasetCount()) { // we need the dataset to make continue; // a link to the axes } 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: 8 |  | Number of AST nodes: 8

1

    for (int i = rendererCount - 1; i >= 0; i--) {↵

1

    for (int i = rendererCount - 1; i >= 0; i--) {↵

2

                    XYItemRenderer r = getRenderer(i);↵

2

                    XYItemRenderer r = getRenderer(i);↵

3

                    if (i >= getDatasetCount()) { // we need the dataset to make↵

3

                    if (i >= getDatasetCount()) { // we need the dataset to make↵

4

                        continue;                 // a link to the axes↵

4

                        continue;                 // a link to the axes↵

5

                    }↵

5

                    }↵

6

                    if (r != null) {↵

6

                    if (r != null) {↵

7

                        ValueAxis domainAxis = getDomainAxisForDataset(i);↵

7

                        ValueAxis domainAxis = getDomainAxisForDataset(i);↵

8

                        ValueAxis rangeAxis = getRangeAxisForDataset(i);↵

8

                        ValueAxis rangeAxis = getRangeAxisForDataset(i);↵

9

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

9

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

10

                                Layer.BACKGROUND, info);↵

10

                                Layer.FOREGROUND, info);↵

11

                    }↵

11

                    }↵

12

                }

12

                }

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

1. {Refactorable}

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

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

   87

       for (int i = rendererCount - 1; i >= 0; i--)

   97

       for (int i = rendererCount - 1; i >= 0; i--)

   88

       XYItemRenderer r = getRenderer(i);

   98

       XYItemRenderer r = getRenderer(i);

   89

       if (i >= getDatasetCount())

   99

       if (i >= getDatasetCount())

   90

       continue;

   100

       continue;

   91

       if (r != null)

   101

       if (r != null)

   92

       ValueAxis domainAxis = getDomainAxisForDataset(i);

   102

       ValueAxis domainAxis = getDomainAxisForDataset(i);

   93

       ValueAxis rangeAxis = getRangeAxisForDataset(i);

   103

       ValueAxis rangeAxis = getRangeAxisForDataset(i);

   94

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

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

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

   104

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

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