1163-1-2

if (useAnchor) { // get the source coordinate - this plot has always a VERTICAL // orientation double sourceX = source.getX(); double anchorX = this.domainAxis.java2DToValue(sourceX, info.getDataArea(), RectangleEdge.BOTTOM); this.domainAxis.resizeRange(factor, anchorX); } else { this.domainAxis.resizeRange(factor); }
if (useAnchor) { // get the source coordinate - this plot has always a VERTICAL // orientation double sourceX = source.getX(); double anchorX = this.rangeAxis.java2DToValue(sourceX, info.getDataArea(), RectangleEdge.LEFT); this.rangeAxis.resizeRange(factor, anchorX); } else { this.rangeAxis.resizeRange(factor); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java
Method name: `void zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)` |  | Method name: `void zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (useAnchor) {↵

1

    if (useAnchor) {↵

2

                // get the source coordinate - this plot has always a VERTICAL↵

2

                // get the source coordinate - this plot has always a VERTICAL↵

3

                // orientation↵

3

                // orientation↵

4

                double sourceX = source.getX();↵

4

                double sourceX = source.getX();↵

5

                double anchorX = this.domainAxis.java2DToValue(sourceX, ↵

5

                double anchorX = this.rangeAxis.java2DToValue(sourceX, ↵

6

                        info.getDataArea(), RectangleEdge.BOTTOM);↵

6

                        info.getDataArea(), RectangleEdge.LEFT);↵

7

                this.domainAxis.resizeRange(factor, anchorX);↵

7

                this.rangeAxis.resizeRange(factor, anchorX);↵

8

            }↵

8

            }↵

9

            else {↵

9

            else {↵

10

                this.domainAxis.resizeRange(factor);↵

10

                this.rangeAxis.resizeRange(factor);↵

11

            }

11

            }

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 declared in the same class
Number of node comparisons | 25

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

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

   1

       if (useAnchor)

   1

       if (useAnchor)

   2

       double sourceX = source.getX();

   2

       double sourceX = source.getX();

   3

       double anchorX = this.domainAxis.java2DToValue(sourceX, info.getDataArea(), RectangleEdge.BOTTOM);

   3 | double anchorX = this.domainAxis.java2DToValue(sourceX, info.getDataArea(), RectangleEdge.BOTTOM);
   3 | double anchorX = this.rangeAxis.java2DToValue(sourceX, info.getDataArea(), RectangleEdge.LEFT);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   BOTTOM | LEFT | VARIABLE_NAME_MISMATCH
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   3

       double anchorX = this.rangeAxis.java2DToValue(sourceX, info.getDataArea(), RectangleEdge.LEFT);

   4

       this.domainAxis.resizeRange(factor, anchorX);

   4 | this.domainAxis.resizeRange(factor, anchorX);
   4 | this.rangeAxis.resizeRange(factor, anchorX);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   4

       this.rangeAxis.resizeRange(factor, anchorX);

       else

       else

   5

       this.domainAxis.resizeRange(factor);

   5 | this.domainAxis.resizeRange(factor);
   5 | this.rangeAxis.resizeRange(factor);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   5

       this.rangeAxis.resizeRange(factor);

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