378-1-3

if (orientation == PlotOrientation.HORIZONTAL) { space.setLeft(fixed.getLeft()); space.setRight(fixed.getRight()); } else if (orientation == PlotOrientation.VERTICAL) { space.setTop(fixed.getTop()); space.setBottom(fixed.getBottom()); }
if (orientation == PlotOrientation.VERTICAL) { space.setLeft(fixed.getLeft()); space.setRight(fixed.getRight()); } else if (orientation == PlotOrientation.HORIZONTAL) { space.setTop(fixed.getTop()); space.setBottom(fixed.getBottom()); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.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: 6 |  | Number of AST nodes: 6

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.VERTICAL) {↵

2

                    space.setLeft(fixed.getLeft());↵

2

                    space.setLeft(fixed.getLeft());↵

3

                    space.setRight(fixed.getRight());↵

3

                    space.setRight(fixed.getRight());↵

4

                }↵

4

                }↵

5

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

5

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

6

                    space.setTop(fixed.getTop());↵

6

                    space.setTop(fixed.getTop());↵

7

                    space.setBottom(fixed.getBottom());↵

7

                    space.setBottom(fixed.getBottom());↵

8

                }

8

                }

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

1. {Refactorable}

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

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

   5

       if (orientation == PlotOrientation.HORIZONTAL)

   5 | if (orientation == PlotOrientation.HORIZONTAL)
   5 | if (orientation == PlotOrientation.VERTICAL)

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

   5

       if (orientation == PlotOrientation.VERTICAL)

   6

       space.setLeft(fixed.getLeft());

   6

       space.setLeft(fixed.getLeft());

   7

       space.setRight(fixed.getRight());

   7

       space.setRight(fixed.getRight());

   8

       else if (orientation == PlotOrientation.VERTICAL)

   8 | else if (orientation == PlotOrientation.VERTICAL)
   8 | else if (orientation == PlotOrientation.HORIZONTAL)

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

   8

       else if (orientation == PlotOrientation.HORIZONTAL)

   9

       space.setTop(fixed.getTop());

   9

       space.setTop(fixed.getTop());

   10

       space.setBottom(fixed.getBottom());

   10

       space.setBottom(fixed.getBottom());

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