if (index < 0 || index >= getDatasetCount()) { throw new IllegalArgumentException("Index " + index + " out of bounds."); } ValueAxis valueAxis = null; Integer axisIndex = (Integer) this.datasetToDomainAxisMap.get( new Integer(index)); if (axisIndex != null) { valueAxis = getDomainAxis(axisIndex.intValue()); } else { valueAxis = getDomainAxis(0); } return valueAxis;
if (index < 0 || index >= getDatasetCount()) { throw new IllegalArgumentException("Index " + index + " out of bounds."); } ValueAxis valueAxis = null; Integer axisIndex = (Integer) this.datasetToRangeAxisMap.get(new Integer(index)); if (axisIndex != null) { valueAxis = getRangeAxis(axisIndex.intValue()); } else { valueAxis = getRangeAxis(0); } return valueAxis;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: ValueAxis getDomainAxisForDataset(int) Method name: ValueAxis getRangeAxisForDataset(int)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (index < 0 || index >= getDatasetCount()) {
1
if (index < 0 || index >= getDatasetCount()) {
2
            throw new IllegalArgumentException("Index " + index
2
            throw new IllegalArgumentException("Index " + index
3
                    + " out of bounds.");
3
                    + " out of bounds.");
4
        }
4
        }
5
        ValueAxis valueAxis = null;
5
        ValueAxis valueAxis = null;
6
        Integer axisIndex
6
        Integer axisIndex
7
 = (Integer) this.datasetToDomainAxisMap.get(
7
            = (Integer) this.datasetToRangeAxisMap.get(
8
                new Integer(index));
8
new Integer(index));
9
        if (axisIndex != null) {
9
        if (axisIndex != null) {
10
            valueAxis = getDomainAxis(axisIndex.intValue());
10
            valueAxis = getRangeAxis(axisIndex.intValue());
11
        }
11
        }
12
        else {
12
        else {
13
            valueAxis = getDomainAxis(0);
13
            valueAxis = getRangeAxis(0);
14
        }
14
        }
15
        return valueAxis;
15
        return valueAxis;
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 declared in the same class
Number of node comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (index < 0 || index >= getDatasetCount())
    1
    if (index < 0 || index >= getDatasetCount())
    2
    throw new IllegalArgumentException("Index " + index + " out of bounds.");
    2
    throw new IllegalArgumentException("Index " + index + " out of bounds.");
    3
    ValueAxis valueAxis = null;
    3
    ValueAxis valueAxis = null;
    4
    Integer axisIndex = (Integer)this.datasetToDomainAxisMap.get(new Integer(index));
    4
    Integer axisIndex = (Integer)this.datasetToDomainAxisMap.get(new Integer(index));
    4
    Integer axisIndex = (Integer)this.datasetToRangeAxisMap.get(new Integer(index));
    Differences
    Expression1Expression2Difference
    datasetToDomainAxisMapdatasetToRangeAxisMapVARIABLE_NAME_MISMATCH
    4
    Integer axisIndex = (Integer)this.datasetToRangeAxisMap.get(new Integer(index));
    5
    if (axisIndex != null)
    5
    if (axisIndex != null)
    6
    valueAxis = getDomainAxis(axisIndex.intValue());
    6
    valueAxis = getDomainAxis(axisIndex.intValue());
    6
    valueAxis = getRangeAxis(axisIndex.intValue());
    Differences
    Expression1Expression2Difference
    getDomainAxisgetRangeAxisMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getDomainAxis(axisIndex.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRangeAxis(axisIndex.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    valueAxis = getRangeAxis(axisIndex.intValue());
    else
    else
    7
    valueAxis = getDomainAxis(0);
    7
    valueAxis = getDomainAxis(0);
    7
    valueAxis = getRangeAxis(0);
    Differences
    Expression1Expression2Difference
    getDomainAxisgetRangeAxisMETHOD_INVOCATION_NAME_MISMATCH
    7
    valueAxis = getRangeAxis(0);
    8
    return valueAxis;
    8
    return valueAxis;
    Precondition Violations (2)
    Row Violation
    1Expression getDomainAxis(axisIndex.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getRangeAxis(axisIndex.intValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted