CategoryAxis result = null; if (index < this.domainAxes.size()) { result = (CategoryAxis) this.domainAxes.get(index); } if (result == null) { Plot parent = getParent(); if (parent instanceof CategoryPlot) { CategoryPlot cp = (CategoryPlot) parent; result = cp.getDomainAxis(index); } } return result;
ValueAxis result = null; if (index < this.domainAxes.size()) { result = (ValueAxis) this.domainAxes.get(index); } if (result == null) { Plot parent = getParent(); if (parent instanceof XYPlot) { XYPlot xy = (XYPlot) parent; result = xy.getDomainAxis(index); } } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: CategoryAxis getDomainAxis(int) Method name: ValueAxis getDomainAxis(int)
Number of AST nodes: 9 Number of AST nodes: 9
1
CategoryAxis result = null;
1
ValueAxis result = null;
2
        if (index < this.domainAxes.size()) {
2
        if (index < this.domainAxes.size()) {
3
            result = (CategoryAxis) this.domainAxes.get(index);
3
            result = (ValueAxis) this.domainAxes.get(index);
4
        }
4
        }
5
        if (result == null) {
5
        if (result == null) {
6
            Plot parent = getParent();
6
            Plot parent = getParent();
7
            if (parent instanceof CategoryPlot) {
7
            if (parent instanceof XYPlot) {
8
                CategoryPlot cp = (CategoryPlot) parent;
8
                XYPlot xy = (XYPlot) parent;
9
                result = cp.getDomainAxis(index);
9
                result = xy.getDomainAxis(index);
10
            }
10
            }
11
        }
11
        }
12
        return result;
12
        return result;
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)1.0
Clones locationClones are in different classes having the same super class
Number of node comparisons21
  1. {Non-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)26.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CategoryAxis result = null;
    1
    CategoryAxis result = null;
    1
    ValueAxis result = null;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    1
    ValueAxis result = null;
    2
    if (index < this.domainAxes.size())
    2
    if (index < this.domainAxes.size())
    3
    result = (CategoryAxis)this.domainAxes.get(index);
    3
    result = (CategoryAxis)this.domainAxes.get(index);
    3
    result = (ValueAxis)this.domainAxes.get(index);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (CategoryAxis)this.domainAxes.get(index) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (ValueAxis)this.domainAxes.get(index) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    result = (ValueAxis)this.domainAxes.get(index);
    4
    if (result == null)
    4
    if (result == null)
    4
    if (result == null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    4
    if (result == null)
    5
    Plot parent = getParent();
    5
    Plot parent = getParent();
    6
    if (parent instanceof CategoryPlot)
    6
    if (parent instanceof CategoryPlot)
    6
    if (parent instanceof XYPlot)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression parent instanceof CategoryPlot cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression parent instanceof XYPlot cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (parent instanceof XYPlot)
    7
    CategoryPlot cp = (CategoryPlot)parent;
    7
    CategoryPlot cp = (CategoryPlot)parent;
    7
    XYPlot xy = (XYPlot)parent;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    cpxyVARIABLE_NAME_MISMATCH
    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)parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (XYPlot)parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    XYPlot xy = (XYPlot)parent;
    8
    result = cp.getDomainAxis(index);
    8
    result = cp.getDomainAxis(index);
    8
    result = xy.getDomainAxis(index);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    cpxyVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression cp cannot be unified with expression xy , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.axis.CategoryAxis getDomainAxis(int) , public org.jfree.chart.axis.ValueAxis getDomainAxis(int)
    8
    result = xy.getDomainAxis(index);
    9
    return result;
    9
    return result;
    9
    return result;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    9
    return result;
    Precondition Violations (7)
    Row Violation
    1Expression (CategoryAxis)this.domainAxes.get(index) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (ValueAxis)this.domainAxes.get(index) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression parent instanceof CategoryPlot cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression parent instanceof XYPlot cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression (CategoryPlot)parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression (XYPlot)parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression cp cannot be unified with expression xy , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.chart.axis.CategoryAxis getDomainAxis(int) , public org.jfree.chart.axis.ValueAxis getDomainAxis(int)