for (int i = 0; i < n; i++) { XYPlot plot = (XYPlot) this.subplots.get(i); // calculate sub-plot area 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; } AxisSpace subSpace = plot.calculateRangeAxisSpace(g2, this.subplotAreas[i], null); space.ensureAtLeast(subSpace); }
for (int i = 0; i < n; i++) { CategoryPlot plot = (CategoryPlot) this.subplots.get(i); // calculate sub-plot area 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; } AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotArea[i], null); space.ensureAtLeast(subSpace); }
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/CombinedRangeCategoryPlot.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
for (int i = 0; i < n; i++) {
1
for (int i = 0; i < n; i++) {
2
            XYPlot plot = (XYPlot) this.subplots.get(i);
2
            CategoryPlot plot = (CategoryPlot) this.subplots.get(i);
3
            // calculate sub-plot area
3
            // calculate sub-plot area
4
            if (orientation == PlotOrientation.HORIZONTAL) {
4
            if (orientation == PlotOrientation.VERTICAL) {
5
                double w = usableSize * plot.getWeight() / this.totalWeight;
5
                double w = usableSize * plot.getWeight() / this.totalWeight;
6
                this.subplotAreas[i] = new Rectangle2D.Double(x, y, w,
6
                this.subplotArea[i] = new Rectangle2D.Double(x, y, w, 
7
                        adjustedPlotArea.getHeight());
7
                        adjustedPlotArea.getHeight());
8
                x = x + w + this.gap;
8
                x = x + w + this.gap;
9
            }
9
            }
10
            else if (orientation == PlotOrientation.VERTICAL) {
10
            else if (orientation == PlotOrientation.HORIZONTAL) {
11
                double h = usableSize * plot.getWeight() / this.totalWeight;
11
                double h = usableSize * plot.getWeight() / this.totalWeight;
12
                this.subplotAreas[i] = new Rectangle2D.Double(x, y,
12
                this.subplotArea[i] = new Rectangle2D.Double(x, y, 
13
                        adjustedPlotArea.getWidth(), h);
13
                        adjustedPlotArea.getWidth(), h);
14
                y = y + h + this.gap;
14
                y = y + h + this.gap;
15
            }
15
            }
16
            AxisSpace subSpace = plot.calculateRangeAxisSpace(g2,
16
            AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, 
17
                    this.subplotAreas[i], null);
17
                    this.subplotArea[i], null);
18
            space.ensureAtLeast(subSpace);
18
            space.ensureAtLeast(subSpace);
19
        }
19
        }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0