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);
XYPlot plot = (XYPlot) this.subplots.get(i); // calculate sub-plot area if (orientation == PlotOrientation.VERTICAL) { 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.HORIZONTAL) { 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.calculateDomainAxisSpace(g2, this.subplotAreas[i], null); space.ensureAtLeast(subSpace);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.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: 11 Number of AST nodes: 11
1
CategoryPlot plot = (CategoryPlot) this.subplots.get(i);
1
XYPlot plot = (XYPlot) this.subplots.get(i);
2
            // calculate sub-plot area
2
            // calculate sub-plot area
3
            if (orientation == PlotOrientation.VERTICAL) {
3
            if (orientation == PlotOrientation.VERTICAL) {
4
                double w = usableSize * plot.getWeight() / this.totalWeight;
4
                double w = usableSize * plot.getWeight() / this.totalWeight;
5
                this.subplotArea[i] = new Rectangle2D.Double(x, y, w, 
5
                this.subplotAreas[i] = new Rectangle2D.Double(x, y, w,
6
                        adjustedPlotArea.getHeight());
6
                        adjustedPlotArea.getHeight());
7
                x = x + w + this.gap;
7
                x = x + w + this.gap;
8
            }
8
            }
9
            else if (orientation == PlotOrientation.HORIZONTAL) {
9
            else if (orientation == PlotOrientation.HORIZONTAL) {
10
                double h = usableSize * plot.getWeight() / this.totalWeight;
10
                double h = usableSize * plot.getWeight() / this.totalWeight;
11
                this.subplotArea[i] = new Rectangle2D.Double(x, y, 
11
                this.subplotAreas[i] = new Rectangle2D.Double(x, y,
12
                        adjustedPlotArea.getWidth(), h);
12
                        adjustedPlotArea.getWidth(), h);
13
                y = y + h + this.gap;
13
                y = y + h + this.gap;
14
            }
14
            }
15
            AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, 
15
            AxisSpace subSpace = plot.calculateDomainAxisSpace(g2,
16
                    this.subplotArea[i], null);
16
                    this.subplotAreas[i], null);
17
            space.ensureAtLeast(subSpace);
17
            space.ensureAtLeast(subSpace);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes having the same super class
Number of node comparisons59
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)22.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    26
    CategoryPlot plot = (CategoryPlot)this.subplots.get(i);
    26
    CategoryPlot plot = (CategoryPlot)this.subplots.get(i);
    26
    XYPlot plot = (XYPlot)this.subplots.get(i);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    26
    XYPlot plot = (XYPlot)this.subplots.get(i);
    27
    if (orientation == PlotOrientation.VERTICAL)
    27
    if (orientation == PlotOrientation.VERTICAL)
    28
    double w = usableSize * plot.getWeight() / this.totalWeight;
    28
    double w = usableSize * plot.getWeight() / this.totalWeight;
    28
    double w = usableSize * plot.getWeight() / this.totalWeight;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_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()
    28
    double w = usableSize * plot.getWeight() / this.totalWeight;
    29
    this.subplotArea[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
    29
    this.subplotArea[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
    29
    this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
    Differences
    Expression1Expression2Difference
    subplotAreasubplotAreasVARIABLE_NAME_MISMATCH
    29
    this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
    30
    x = x + w + this.gap;
    30
    x = x + w + this.gap;
    31
    else if (orientation == PlotOrientation.HORIZONTAL)
    31
    else if (orientation == PlotOrientation.HORIZONTAL)
    32
    double h = usableSize * plot.getWeight() / this.totalWeight;
    32
    double h = usableSize * plot.getWeight() / this.totalWeight;
    32
    double h = usableSize * plot.getWeight() / this.totalWeight;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_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;
    33
    this.subplotArea[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
    33
    this.subplotArea[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
    33
    this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
    Differences
    Expression1Expression2Difference
    subplotAreasubplotAreasVARIABLE_NAME_MISMATCH
    33
    this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
    34
    y = y + h + this.gap;
    34
    y = y + h + this.gap;
    35
    AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotArea[i], null);
    35
    AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotArea[i], null);
    35
    AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotAreas[i], null);
    Differences
    Expression1Expression2Difference
    subplotAreasubplotAreasVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression this.subplotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.subplotAreas cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) protected org.jfree.chart.axis.AxisSpace calculateDomainAxisSpace(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.axis.AxisSpace)
    35
    AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotAreas[i], null);
    36
    space.ensureAtLeast(subSpace);
    36
    space.ensureAtLeast(subSpace);
    Precondition Violations (6)
    Row Violation
    1Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()
    2Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()
    3Expression this.subplotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.subplotAreas cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) protected org.jfree.chart.axis.AxisSpace calculateDomainAxisSpace(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.axis.AxisSpace)
    6Clone fragment #1 returns variables x, y , while Clone fragment #2 returns variables x, y