if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } Range result = null; if (dataset instanceof RangeInfo) { RangeInfo info = (RangeInfo) dataset; result = info.getRangeBounds(includeInterval); } else { result = iterateRangeBounds(dataset, includeInterval); } return result;
if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } Range result = null; if (dataset instanceof RangeInfo) { RangeInfo info = (RangeInfo) dataset; result = info.getRangeBounds(includeInterval); } else { result = iterateRangeBounds(dataset, includeInterval); } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
Method name: Range findRangeBounds(CategoryDataset, boolean) Method name: Range findRangeBounds(XYDataset, boolean)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (dataset == null) {
1
if (dataset == null) {
2
            throw new IllegalArgumentException("Null 'dataset' argument.");
2
            throw new IllegalArgumentException("Null 'dataset' argument.");
3
        }
3
        }
4
        Range result = null;
4
        Range result = null;
5
        if (dataset instanceof RangeInfo) {
5
        if (dataset instanceof RangeInfo) {
6
            RangeInfo info = (RangeInfo) dataset;
6
            RangeInfo info = (RangeInfo) dataset;
7
            result = info.getRangeBounds(includeInterval);
7
            result = info.getRangeBounds(includeInterval);
8
        }
8
        }
9
        else {
9
        else {
10
            result = iterateRangeBounds(dataset, includeInterval);
10
            result = iterateRangeBounds(dataset, includeInterval);
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)0.3
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Non-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)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (dataset == null)
    1
    if (dataset == null)
    1
    if (dataset == null)
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.CategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    1
    if (dataset == null)
    2
    throw new IllegalArgumentException("Null 'dataset' argument.");
    2
    throw new IllegalArgumentException("Null 'dataset' argument.");
    3
    Range result = null;
    3
    Range result = null;
    4
    if (dataset instanceof RangeInfo)
    4
    if (dataset instanceof RangeInfo)
    4
    if (dataset instanceof RangeInfo)
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.CategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    4
    if (dataset instanceof RangeInfo)
    5
    RangeInfo info = (RangeInfo)dataset;
    5
    RangeInfo info = (RangeInfo)dataset;
    5
    RangeInfo info = (RangeInfo)dataset;
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.CategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    5
    RangeInfo info = (RangeInfo)dataset;
    6
    result = info.getRangeBounds(includeInterval);
    6
    result = info.getRangeBounds(includeInterval);
    else
    else
    7
    result = iterateRangeBounds(dataset, includeInterval);
    7
    result = iterateRangeBounds(dataset, includeInterval);
    7
    result = iterateRangeBounds(dataset, includeInterval);
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.CategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression dataset cannot be unified with expression dataset , because common superclass type org.jfree.data.general.Dataset cannot be passed as an argument to public static org.jfree.data.Range iterateRangeBounds(org.jfree.data.category.CategoryDataset, boolean)
    7
    result = iterateRangeBounds(dataset, includeInterval);
    8
    return result;
    8
    return result;
    Precondition Violations (1)
    Row Violation
    1Expression dataset cannot be unified with expression dataset , because common superclass type org.jfree.data.general.Dataset cannot be passed as an argument to public static org.jfree.data.Range iterateRangeBounds(org.jfree.data.category.CategoryDataset, boolean)