359-1-2

if (orientation == PlotOrientation.HORIZONTAL) { float x = (float) axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()); float y = (float) adjusted.getMaxY(); path = new GeneralPath(); path.moveTo(x, y); path.lineTo((float) (x + getXOffset()), y - (float) getYOffset()); path.lineTo((float) (x + getXOffset()), (float) (adjusted.getMinY() - getYOffset())); path.lineTo(x, (float) adjusted.getMinY()); path.closePath(); } else if (orientation == PlotOrientation.VERTICAL) { float y = (float) axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()); float x = (float) dataArea.getX(); path = new GeneralPath(); path.moveTo(x, y); path.lineTo(x + (float) this.xOffset, y - (float) this.yOffset); path.lineTo((float) (adjusted.getMaxX() + this.xOffset), y - (float) this.yOffset); path.lineTo((float) (adjusted.getMaxX()), y); path.closePath(); }
if (orientation == PlotOrientation.HORIZONTAL) { float x = (float) axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()); float y = (float) adjusted.getMaxY(); path = new GeneralPath(); path.moveTo(x, y); path.lineTo((float) (x + getXOffset()), y - (float) getYOffset()); path.lineTo((float) (x + getXOffset()), (float) (adjusted.getMinY() - getYOffset())); path.lineTo(x, (float) adjusted.getMinY()); path.closePath(); } else if (orientation == PlotOrientation.VERTICAL) { float y = (float) axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()); float x = (float) dataArea.getX(); path = new GeneralPath(); path.moveTo(x, y); path.lineTo(x + (float) this.xOffset, y - (float) this.yOffset); path.lineTo((float) (adjusted.getMaxX() + this.xOffset), y - (float) this.yOffset); path.lineTo((float) (adjusted.getMaxX()), y); path.closePath(); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer3D.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LineRenderer3D.java
Method name: `void drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, Rectangle2D)` |  | Method name: `void drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, Rectangle2D)`
Number of AST nodes: 18 |  | Number of AST nodes: 18

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

2

                    float x = (float) axis.valueToJava2D(value, adjusted,↵

2

                    float x = (float) axis.valueToJava2D(value, adjusted,↵

3

                            plot.getRangeAxisEdge());↵

3

                            plot.getRangeAxisEdge());↵

4

                    float y = (float) adjusted.getMaxY();↵

4

                    float y = (float) adjusted.getMaxY();↵

5

                    path = new GeneralPath();↵

5

                    path = new GeneralPath();↵

6

                    path.moveTo(x, y);↵

6

                    path.moveTo(x, y);↵

7

                    path.lineTo((float) (x + getXOffset()),↵

7

                    path.lineTo((float) (x + getXOffset()),↵

8

                            y - (float) getYOffset());↵

8

                            y - (float) getYOffset());↵

9

                    path.lineTo((float) (x + getXOffset()),↵

9

                    path.lineTo((float) (x + getXOffset()),↵

10

                            (float) (adjusted.getMinY() - getYOffset()));↵

10

                            (float) (adjusted.getMinY() - getYOffset()));↵

11

                    path.lineTo(x, (float) adjusted.getMinY());↵

11

                    path.lineTo(x, (float) adjusted.getMinY());↵

12

                    path.closePath();↵

12

                    path.closePath();↵

13

                }↵

13

                }↵

14

                else if (orientation == PlotOrientation.VERTICAL) {↵

14

                else if (orientation == PlotOrientation.VERTICAL) {↵

15

                    float y = (float) axis.valueToJava2D(value, adjusted,↵

15

                    float y = (float) axis.valueToJava2D(value, adjusted,↵

16

                            plot.getRangeAxisEdge());↵

16

                            plot.getRangeAxisEdge());↵

17

                    float x = (float) dataArea.getX();↵

17

                    float x = (float) dataArea.getX();↵

18

                    path = new GeneralPath();↵

18

                    path = new GeneralPath();↵

19

                    path.moveTo(x, y);↵

19

                    path.moveTo(x, y);↵

20

                    path.lineTo(x + (float) this.xOffset, y - (float) this.yOffset);↵

20

                    path.lineTo(x + (float) this.xOffset, y - (float) this.yOffset);↵

21

                    path.lineTo((float) (adjusted.getMaxX() + this.xOffset),↵

21

                    path.lineTo((float) (adjusted.getMaxX() + this.xOffset),↵

22

                            y - (float) this.yOffset);↵

22

                            y - (float) this.yOffset);↵

23

                    path.lineTo((float) (adjusted.getMaxX()), y);↵

23

                    path.lineTo((float) (adjusted.getMaxX()), y);↵

24

                    path.closePath();↵

24

                    path.closePath();↵

25

                }

25

                }

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 18
   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) | 39.1
   Clone type | Type 1

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

   10

       if (orientation == PlotOrientation.HORIZONTAL)

   10

       if (orientation == PlotOrientation.HORIZONTAL)

   11

       float x = (float)axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge());

   11

       float x = (float)axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge());

   12

       float y = (float)adjusted.getMaxY();

   12

       float y = (float)adjusted.getMaxY();

   13

       path = new GeneralPath();

   13

       path = new GeneralPath();

   14

       path.moveTo(x, y);

   14

       path.moveTo(x, y);

   15

       path.lineTo((float)(x + getXOffset()), y - (float)getYOffset());

   15

       path.lineTo((float)(x + getXOffset()), y - (float)getYOffset());

   16

       path.lineTo((float)(x + getXOffset()), (float)(adjusted.getMinY() - getYOffset()));

   16

       path.lineTo((float)(x + getXOffset()), (float)(adjusted.getMinY() - getYOffset()));

   17

       path.lineTo(x, (float)adjusted.getMinY());

   17

       path.lineTo(x, (float)adjusted.getMinY());

   18

       path.closePath();

   18

       path.closePath();

   19

       else if (orientation == PlotOrientation.VERTICAL)

   19

       else if (orientation == PlotOrientation.VERTICAL)

   20

       float y = (float)axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge());

   20

       float y = (float)axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge());

   21

       float x = (float)dataArea.getX();

   21

       float x = (float)dataArea.getX();

   22

       path = new GeneralPath();

   22

       path = new GeneralPath();

   23

       path.moveTo(x, y);

   23

       path.moveTo(x, y);

   24

       path.lineTo(x + (float)this.xOffset, y - (float)this.yOffset);

   24

       path.lineTo(x + (float)this.xOffset, y - (float)this.yOffset);

   25

       path.lineTo((float)(adjusted.getMaxX() + this.xOffset), y - (float)this.yOffset);

   25

       path.lineTo((float)(adjusted.getMaxX() + this.xOffset), y - (float)this.yOffset);

   26

       path.lineTo((float)(adjusted.getMaxX()), y);

   26

       path.lineTo((float)(adjusted.getMaxX()), y);

   27

       path.closePath();

   27

       path.closePath();

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