if (info == null) { throw new IllegalArgumentException("Null 'info' argument."); } if (source == null) { throw new IllegalArgumentException("Null 'source' argument."); } CategoryPlot result = null; int subplotIndex = info.getSubplotIndex(source); if (subplotIndex >= 0) { result = (CategoryPlot) this.subplots.get(subplotIndex); } return result;
if (info == null) { throw new IllegalArgumentException("Null 'info' argument."); } if (source == null) { throw new IllegalArgumentException("Null 'source' argument."); } XYPlot result = null; int subplotIndex = info.getSubplotIndex(source); if (subplotIndex >= 0) { result = (XYPlot) this.subplots.get(subplotIndex); } return result;
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: CategoryPlot findSubplot(PlotRenderingInfo, Point2D) Method name: XYPlot findSubplot(PlotRenderingInfo, Point2D)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (info == null) {
1
if (info == null) {
2
            throw new IllegalArgumentException("Null 'info' argument.");
2
            throw new IllegalArgumentException("Null 'info' argument.");
3
        }
3
        }
4
        if (source == null) {
4
        if (source == null) {
5
            throw new IllegalArgumentException("Null 'source' argument.");
5
            throw new IllegalArgumentException("Null 'source' argument.");
6
        }
6
        }
7
        CategoryPlot result = null;
7
        XYPlot result = null;
8
        int subplotIndex = info.getSubplotIndex(source);
8
        int subplotIndex = info.getSubplotIndex(source);
9
        if (subplotIndex >= 0) {
9
        if (subplotIndex >= 0) {
10
            result =  (CategoryPlot) this.subplots.get(subplotIndex);
10
            result =  (XYPlot) this.subplots.get(subplotIndex);
11
        }
11
        }
12
        return result;
12
        return result;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in different classes having the same super class
Number of node comparisons30
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (info == null)
    1
    if (info == null)
    2
    throw new IllegalArgumentException("Null 'info' argument.");
    2
    throw new IllegalArgumentException("Null 'info' argument.");
    3
    if (source == null)
    3
    if (source == null)
    4
    throw new IllegalArgumentException("Null 'source' argument.");
    4
    throw new IllegalArgumentException("Null 'source' argument.");
    5
    CategoryPlot result = null;
    5
    CategoryPlot result = null;
    5
    XYPlot result = null;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    5
    XYPlot result = null;
    6
    int subplotIndex = info.getSubplotIndex(source);
    6
    int subplotIndex = info.getSubplotIndex(source);
    7
    if (subplotIndex >= 0)
    7
    if (subplotIndex >= 0)
    8
    result = (CategoryPlot)this.subplots.get(subplotIndex);
    8
    result = (CategoryPlot)this.subplots.get(subplotIndex);
    8
    result = (XYPlot)this.subplots.get(subplotIndex);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (CategoryPlot)this.subplots.get(subplotIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (XYPlot)this.subplots.get(subplotIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    result = (XYPlot)this.subplots.get(subplotIndex);
    9
    return result;
    9
    return result;
    9
    return result;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    9
    return result;
    Precondition Violations (2)
    Row Violation
    1Expression (CategoryPlot)this.subplots.get(subplotIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (XYPlot)this.subplots.get(subplotIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted