336-1-2

if (getPlotLines()) { if (item > 0) { if (plot.getOrientation() == PlotOrientation.VERTICAL) { areaState.line.setLine(transX0, transY0, transX1, transY1); } else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { areaState.line.setLine(transY0, transX0, transY1, transX1); } g2.draw(areaState.line); } }
if (getPlotLines()) { if (item > 0) { if (plot.getOrientation() == PlotOrientation.VERTICAL) { state.workingLine.setLine(transX0, transY0, transX1, transY1); } else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { state.workingLine.setLine(transY0, transX0, transY1, transX1); } g2.draw(state.workingLine); } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer2.java
Method name: `void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)` |  | Method name: `void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (getPlotLines()) {↵

1

    if (getPlotLines()) {↵

2

                if (item > 0) {↵

2

                if (item > 0) {↵

3

                    if (plot.getOrientation() == PlotOrientation.VERTICAL) {↵

3

                    if (plot.getOrientation() == PlotOrientation.VERTICAL) {↵

4

                        areaState.line.setLine(transX0, transY0, transX1, ↵

4

                        state.workingLine.setLine(transX0, transY0, transX1, ↵

5

    transY1);↵

5

                                transY1);↵

6

                    }↵

6

                    }↵

7

                    else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) {↵

7

                    else if (plot.getOrientation() == PlotOrientation.HORIZONTAL) {↵

8

                        areaState.line.setLine(transY0, transX0, transY1, ↵

8

                        state.workingLine.setLine(transY0, transX0, transY1, ↵

9

    transX1);↵

9

                                transX1);↵

10

                    }↵

10

                    }↵

11

                    g2.draw(areaState.line);↵

11

                    g2.draw(state.workingLine);↵

12

                }↵

12

                }↵

13

            }

13

            }

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

1. {Refactorable}

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

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

   62

       if (getPlotLines())

   42

       if (getPlotLines())

   63

       if (item > 0)

   43

       if (item > 0)

   64

       if (plot.getOrientation() == PlotOrientation.VERTICAL)

   44

       if (plot.getOrientation() == PlotOrientation.VERTICAL)

   65

       areaState.line.setLine(transX0, transY0, transX1, transY1);

   65 | areaState.line.setLine(transX0, transY0, transX1, transY1);
   45 | state.workingLine.setLine(transX0, transY0, transX1, transY1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   areaState | state | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.XYAreaRenderer.XYAreaRendererState | org.jfree.chart.renderer.xy.XYItemRendererState | SUBCLASS_TYPE_MISMATCH
   line | workingLine | VARIABLE_NAME_MISMATCH

   45

       state.workingLine.setLine(transX0, transY0, transX1, transY1);

   66

       else if (plot.getOrientation() == PlotOrientation.HORIZONTAL)

   46

       else if (plot.getOrientation() == PlotOrientation.HORIZONTAL)

   67

       areaState.line.setLine(transY0, transX0, transY1, transX1);

   67 | areaState.line.setLine(transY0, transX0, transY1, transX1);
   47 | state.workingLine.setLine(transY0, transX0, transY1, transX1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   areaState | state | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.XYAreaRenderer.XYAreaRendererState | org.jfree.chart.renderer.xy.XYItemRendererState | SUBCLASS_TYPE_MISMATCH
   line | workingLine | VARIABLE_NAME_MISMATCH

   47

       state.workingLine.setLine(transY0, transX0, transY1, transX1);

   68

       g2.draw(areaState.line);

   68 | g2.draw(areaState.line);
   48 | g2.draw(state.workingLine);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   areaState | state | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.XYAreaRenderer.XYAreaRendererState | org.jfree.chart.renderer.xy.XYItemRendererState | SUBCLASS_TYPE_MISMATCH
   line | workingLine | VARIABLE_NAME_MISMATCH

   48

       g2.draw(state.workingLine);

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