372-1-2

if (p instanceof Zoomable) { Zoomable z = (Zoomable) p; if (z.getOrientation() == PlotOrientation.HORIZONTAL) { z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin); z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin); } else { z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin); z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin); } }
if (p instanceof Zoomable) { Zoomable z = (Zoomable) p; if (z.getOrientation() == PlotOrientation.HORIZONTAL) { z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin); z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin); } else { z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin); z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin); } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/ChartComposite.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java
Method name: `void zoom(Rectangle)` |  | Method name: `void zoom(Rectangle2D)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (p instanceof Zoomable) {↵

1

    if (p instanceof Zoomable) {
    ↵

2

                    Zoomable z = (Zoomable) p;↵

2

                    Zoomable z = (Zoomable) p;
    ↵

3

                    if (z.getOrientation() == PlotOrientation.HORIZONTAL) {↵

3

                    if (z.getOrientation() == PlotOrientation.HORIZONTAL) {
    ↵

4

                        z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);↵

4

                        z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);
    ↵

5

                        z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);↵

5

                        z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);
    ↵

6

                    }↵

6

                    }
    ↵

7

                    else {↵

7

                    else {
    ↵

8

                        z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);↵

8

                        z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);
    ↵

9

                        z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);↵

9

                        z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);
    ↵

10

                    }↵

10

                    }
    ↵

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.5
Clones location | Clones are in different classes
Number of node comparisons | 30

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) | 2.9
   Clone type | Type 1

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

   10

       if (p instanceof Zoomable)

   10

       if (p instanceof Zoomable)

   11

       Zoomable z = (Zoomable)p;

   11

       Zoomable z = (Zoomable)p;

   12

       if (z.getOrientation() == PlotOrientation.HORIZONTAL)

   12

       if (z.getOrientation() == PlotOrientation.HORIZONTAL)

   13

       z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);

   13

       z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);

   14

       z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);

   14

       z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);

       else

       else

   15

       z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);

   15

       z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);

   16

       z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);

   16

       z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);

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