1359-1-2

Plot p = this.chart.getPlot(); if (p instanceof Zoomable) { Zoomable z = (Zoomable) p; // we need to guard against this.zoomPoint being null Point2D zp = (this.zoomPoint != null ? this.zoomPoint : new Point()); z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp); }
Plot p = this.chart.getPlot(); if (p instanceof Zoomable) { Zoomable z = (Zoomable) p; // we need to guard against this.zoomPoint being null Point2D zp = (this.zoomPoint != null ? this.zoomPoint : new Point()); z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java
Method name: `void restoreAutoDomainBounds()` |  | Method name: `void restoreAutoRangeBounds()`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    Plot p = this.chart.getPlot();↵

1

    Plot p = this.chart.getPlot();↵

2

            if (p instanceof Zoomable) {↵

2

            if (p instanceof Zoomable) {↵

3

                Zoomable z = (Zoomable) p;↵

3

                Zoomable z = (Zoomable) p;↵

4

                // we need to guard against this.zoomPoint being null↵

4

                // we need to guard against this.zoomPoint being null↵

5

                Point2D zp = (this.zoomPoint != null↵

5

                Point2D zp = (this.zoomPoint != null↵

6

                		? this.zoomPoint : new Point());↵

6

                		? this.zoomPoint : new Point());↵

7

                z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp);↵

7

                z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);↵

8

            }

8

            }

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

1. {Non-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) | 1.1
   Clone type | Type 2

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

   1

       Plot p = this.chart.getPlot();

   1

       Plot p = this.chart.getPlot();

   2

       if (p instanceof Zoomable)

   2

       if (p instanceof Zoomable)

   3

       Zoomable z = (Zoomable)p;

   3

       Zoomable z = (Zoomable)p;

   4

       Point2D zp = (this.zoomPoint != null ? this.zoomPoint : new Point());

   4

       Point2D zp = (this.zoomPoint != null ? this.zoomPoint : new Point());

   5

       z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp);

   5 | z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp);
   5 | z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   zoomDomainAxes | zoomRangeAxes | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),zp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),zp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),zp) is a void method call, and thus it cannot be parameterized
   Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),zp) is a void method call, and thus it cannot be parameterized

   5

       z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),zp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),zp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),zp) is a void method call, and thus it cannot be parameterized
   4 | Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),zp) is a void method call, and thus it cannot be parameterized