1730-1-4

if (orientation == PlotOrientation.HORIZONTAL) { usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1); } else if (orientation == PlotOrientation.VERTICAL) { usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1); }
if (orientation == PlotOrientation.VERTICAL) { usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1); } else if (orientation == PlotOrientation.HORIZONTAL) { usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1); }

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/CombinedRangeXYPlot.java
Method name: `AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)` |  | Method name: `AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.VERTICAL) {↵

2

                usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);↵

2

                usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);↵

3

            }↵

3

            }↵

4

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

4

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

5

                usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);↵

5

                usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);↵

6

            }

6

            }

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

1. {Refactorable}

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

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

   23

       if (orientation == PlotOrientation.HORIZONTAL)

   23

       if (orientation == PlotOrientation.HORIZONTAL)

   24

       usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);

   24 | usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);
   24 | usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getWidth | getHeight | METHOD_INVOCATION_NAME_MISMATCH

   24

       usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);

   25

       else if (orientation == PlotOrientation.VERTICAL)

   21

       else if (orientation == PlotOrientation.VERTICAL)

   26

       usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);

   26 | usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);
   22 | usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getHeight | getWidth | METHOD_INVOCATION_NAME_MISMATCH

   22

       usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);

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