1243-1-3

int columnCount = data.getColumnCount(); for (int c = 0; c < columnCount; c++) { double xx = axis.getCategoryJava2DCoordinate( anchor, c, columnCount, dataArea, domainAxisEdge); CategoryItemRenderer renderer1 = getRenderer(); if (renderer1 != null) { renderer1.drawDomainGridline(g2, this, dataArea, xx); } }
for (int i = 0; i < rendererCount; i++) { 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/CategoryPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: `void drawDomainGridlines(Graphics2D, Rectangle2D)` |  | Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    int columnCount = data.getColumnCount();↵

2

                            for (int c = 0; c < columnCount; c++) {↵

1

    for (int i = 0; i < rendererCount; i++) {↵

3

                                double xx = axis.getCategoryJava2DCoordinate(↵

2

                    ↵

4

                                        anchor, c, columnCount, dataArea,↵

5

                                        domainAxisEdge);↵

6

                                CategoryItemRenderer renderer1 = getRenderer();↵

7

                                if (renderer1 != null) {↵

8

                                    renderer1.drawDomainGridline(g2, this,↵

9

                                            dataArea, xx);↵

10

                                }↵

11

                ↵

3

    XYItemRenderer r = getRenderer(i);↵

4

                    if (r != null) {↵

5

                        ValueAxis domainAxis = getDomainAxisForDataset(i);↵

6

                        ValueAxis rangeAxis = getRangeAxisForDataset(i);↵

7

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

8

                                Layer.FOREGROUND, info);↵

9

                    }↵

12

                }

10

                }

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.4
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 15

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 4
   Number of unmapped statements in the second code fragment | 4
   Time elapsed for statement mapping (ms) | 1.5
   Clone type | Type 3

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

   11

       int columnCount = data.getColumnCount();

   12

       for (int c = 0; c < columnCount; c++)

   12 | for (int c = 0; c < columnCount; c++)
   79 | for (int i = 0; i < rendererCount; i++)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   c | i | VARIABLE_NAME_MISMATCH
   c | i | VARIABLE_NAME_MISMATCH
   columnCount | rendererCount | VARIABLE_NAME_MISMATCH
   c | i | VARIABLE_NAME_MISMATCH

   79

       for (int i = 0; i < rendererCount; i++)

   13

       double xx = axis.getCategoryJava2DCoordinate(anchor, c, columnCount, dataArea, domainAxisEdge);

   13 | double xx = axis.getCategoryJava2DCoordinate(anchor, c, columnCount, dataArea, domainAxisEdge);

   Preondition Violations
   Unmatched statement double xx=axis.getCategoryJava2DCoordinate(anchor,c,columnCount,dataArea,domainAxisEdge); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   14

       CategoryItemRenderer renderer1 = getRenderer();

   14 | CategoryItemRenderer renderer1 = getRenderer();

   Preondition Violations
   Unmatched statement CategoryItemRenderer renderer1=getRenderer(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   80 | XYItemRenderer r = getRenderer(i);

   Preondition Violations
   Unmatched statement XYItemRenderer r=getRenderer(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   80

       XYItemRenderer r = getRenderer(i);

   15

       if (renderer1 != null)

   15 | if (renderer1 != null)
   81 | if (r != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   renderer1 | r | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.CategoryItemRenderer | org.jfree.chart.renderer.xy.XYItemRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.category.CategoryItemRenderer of variable renderer1 does not match with type org.jfree.chart.renderer.xy.XYItemRenderer of variable r
   - Make classes org.jfree.chart.renderer.category.CategoryItemRenderer and org.jfree.chart.renderer.xy.XYItemRenderer extend a common superclass

   81

       if (r != null)

   16

       renderer1.drawDomainGridline(g2, this, dataArea, xx);

   82 | ValueAxis domainAxis = getDomainAxisForDataset(i);

   Preondition Violations
   Unmatched statement ValueAxis domainAxis=getDomainAxisForDataset(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   82

       ValueAxis domainAxis = getDomainAxisForDataset(i);

   83 | ValueAxis rangeAxis = getRangeAxisForDataset(i);

   Preondition Violations
   Unmatched statement ValueAxis rangeAxis=getRangeAxisForDataset(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   83

       ValueAxis rangeAxis = getRangeAxisForDataset(i);

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

   Preondition Violations
   Unmatched statement r.drawAnnotations(g2,dataArea,domainAxis,rangeAxis,Layer.FOREGROUND,info); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   84

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

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Unmatched statement double xx=axis.getCategoryJava2DCoordinate(anchor,c,columnCount,dataArea,domainAxisEdge); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   2 | Unmatched statement CategoryItemRenderer renderer1=getRenderer(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   3 | Unmatched statement XYItemRenderer r=getRenderer(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   4 | Type org.jfree.chart.renderer.category.CategoryItemRenderer of variable renderer1 does not match with type org.jfree.chart.renderer.xy.XYItemRenderer of variable r
   5 | Unmatched statement ValueAxis domainAxis=getDomainAxisForDataset(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   6 | Unmatched statement ValueAxis rangeAxis=getRangeAxisForDataset(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   7 | Unmatched statement r.drawAnnotations(g2,dataArea,domainAxis,rangeAxis,Layer.FOREGROUND,info); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted