1741-1-2

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 h = usableSize * plot.getWeight() / this.totalWeight; this.subplotAreas[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/CombinedDomainXYPlot.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.VERTICAL) {↵

1

    if (orientation == PlotOrientation.VERTICAL) {↵

2

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

2

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

3

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

3

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

4

                            adjustedPlotArea.getWidth(), h);↵

4

                            adjustedPlotArea.getWidth(), h);↵

5

                    y = y + h + this.gap;↵

5

                    y = y + h + this.gap;↵

6

                }

6

                }

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

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

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

   33

       else if (orientation == PlotOrientation.VERTICAL)

   31

       else if (orientation == PlotOrientation.VERTICAL)

   34

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CategoryPlot | org.jfree.chart.plot.XYPlot | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()

   32

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

   35

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

   33

       this.subplotAreas[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 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()