1624-1-4

Axis axis = (Axis) iterator.next(); if (axis != null) { AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea, RectangleEdge.TOP, plotState); cursor = axisState.getCursor(); axisStateMap.put(axis, axisState); }
Axis axis = (Axis) iterator.next(); if (axis != null) { AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea, RectangleEdge.RIGHT, plotState); cursor = axisState.getCursor(); axisStateMap.put(axis, axisState); }

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/CategoryPlot.java
Method name: `Map drawAxes(Graphics2D, Rectangle2D, Rectangle2D, PlotRenderingInfo)` |  | Method name: `Map drawAxes(Graphics2D, Rectangle2D, Rectangle2D, PlotRenderingInfo)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    Axis axis = (Axis) iterator.next();↵

1

    Axis axis = (Axis) iterator.next();↵

2

                if (axis != null) {↵

2

                if (axis != null) {↵

3

                    AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea,↵

3

                    AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea,↵

4

                            RectangleEdge.TOP, plotState);↵

4

                            RectangleEdge.RIGHT, plotState);↵

5

                    cursor = axisState.getCursor();↵

5

                    cursor = axisState.getCursor();↵

6

                    axisStateMap.put(axis, axisState);↵

6

                    axisStateMap.put(axis, axisState);↵

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

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) | 35.7
   Clone type | Type 2

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

   14

       Axis axis = (Axis)iterator.next();

   38

       Axis axis = (Axis)iterator.next();

   15

       if (axis != null)

   39

       if (axis != null)

   16

       AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea, RectangleEdge.TOP, plotState);

   16 | AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea, RectangleEdge.TOP, plotState);
   40 | AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea, RectangleEdge.RIGHT, plotState);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   TOP | RIGHT | VARIABLE_NAME_MISMATCH

   40

       AxisState axisState = axis.draw(g2, cursor, plotArea, dataArea, RectangleEdge.RIGHT, plotState);

   17

       cursor = axisState.getCursor();

   41

       cursor = axisState.getCursor();

   18

       axisStateMap.put(axis, axisState);

   42

       axisStateMap.put(axis, axisState);

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