1092-1-3

if (orientation == PlotOrientation.HORIZONTAL) { double w = usableSize * plot.getWeight() / this.totalWeight; this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight()); x = x + w + this.gap; } else if (orientation == PlotOrientation.VERTICAL) { double h = usableSize * plot.getWeight() / this.totalWeight; this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h); y = y + h + this.gap; }
if (orientation == PlotOrientation.VERTICAL) { double w = usableSize * plot.getWeight() / this.totalWeight; this.subplotArea[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight()); x = x + w + this.gap; } else if (orientation == PlotOrientation.HORIZONTAL) { double h = usableSize * plot.getWeight() / this.totalWeight; this.subplotArea[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h); y = y + h + this.gap; }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainCategoryPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java
Method name: `AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)` |  | Method name: `AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.VERTICAL) {↵

2

                    double w = usableSize * plot.getWeight() / this.totalWeight;↵

2

                    double w = usableSize * plot.getWeight() / this.totalWeight;↵

3

                    this.subplotAreas[i] = new Rectangle2D.Double(x, y, w,↵

3

                    this.subplotArea[i] = new Rectangle2D.Double(x, y, w, ↵

4

                            adjustedPlotArea.getHeight());↵

4

                            adjustedPlotArea.getHeight());↵

5

                    x = x + w + this.gap;↵

5

                    x = x + w + this.gap;↵

6

                }↵

6

                }↵

7

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

7

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

8

                    double h = usableSize * plot.getWeight() / this.totalWeight;↵

8

                    double h = usableSize * plot.getWeight() / this.totalWeight;↵

9

                    this.subplotAreas[i] = new Rectangle2D.Double(x, y,↵

9

                    this.subplotArea[i] = new Rectangle2D.Double(x, y, ↵

10

                            adjustedPlotArea.getWidth(), h);↵

10

                            adjustedPlotArea.getWidth(), h);↵

11

                    y = y + h + this.gap;↵

11

                    y = y + h + this.gap;↵

12

                }

12

                }

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   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.5
   Clone type | Type 2

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

   29

       if (orientation == PlotOrientation.HORIZONTAL)

   29 | if (orientation == PlotOrientation.HORIZONTAL)
   27 | if (orientation == PlotOrientation.VERTICAL)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   HORIZONTAL | VERTICAL | VARIABLE_NAME_MISMATCH

   27

       if (orientation == PlotOrientation.VERTICAL)

   30

       double w = usableSize * plot.getWeight() / this.totalWeight;

   28

       double w = usableSize * plot.getWeight() / this.totalWeight;

   31

       this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());

   31 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
   29 | this.subplotArea[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   subplotAreas | subplotArea | VARIABLE_NAME_MISMATCH

   29

       this.subplotArea[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());

   32

       x = x + w + this.gap;

   30

       x = x + w + this.gap;

   33

       else if (orientation == PlotOrientation.VERTICAL)

   33 | else if (orientation == PlotOrientation.VERTICAL)
   31 | else if (orientation == PlotOrientation.HORIZONTAL)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   VERTICAL | HORIZONTAL | VARIABLE_NAME_MISMATCH

   31

       else if (orientation == PlotOrientation.HORIZONTAL)

   34

       double h = usableSize * plot.getWeight() / this.totalWeight;

   32

       double h = usableSize * plot.getWeight() / this.totalWeight;

   35

       this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);

   35 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
   33 | this.subplotArea[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   subplotAreas | subplotArea | VARIABLE_NAME_MISMATCH

   33

       this.subplotArea[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);

   36

       y = y + h + this.gap;

   34

       y = y + h + this.gap;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables x, y , while Clone fragment #2 returns variables x, y