if (dataset != null) { Range r = DatasetUtilities.findDomainBounds(dataset, false); if (r == null) { return null; } else { return new Range(r.getLowerBound() + this.xOffset, r.getUpperBound() + this.blockWidth + this.xOffset); } } else { return null; }
if (dataset != null) { Range r = DatasetUtilities.findRangeBounds(dataset, false); if (r == null) { return null; } else { return new Range(r.getLowerBound() + this.yOffset, r.getUpperBound() + this.blockHeight + this.yOffset); } } else { return null; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBlockRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBlockRenderer.java
Method name: Range findDomainBounds(XYDataset) Method name: Range findRangeBounds(XYDataset)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (dataset != null) {
1
if (dataset != null) {
2
            Range r = DatasetUtilities.findDomainBounds(dataset, false);
2
            Range r = DatasetUtilities.findRangeBounds(dataset, false);
3
            if (r == null) {
3
            if (r == null) {
4
                return null;
4
                return null;
5
            }
5
            }
6
            else {
6
            else {
7
                return new Range(r.getLowerBound() + this.xOffset,
7
                return new Range(r.getLowerBound() + this.yOffset,
8
                        r.getUpperBound() + this.blockWidth + this.xOffset);
8
                        r.getUpperBound() + this.blockHeight + this.yOffset);
9
            }
9
            }
10
        }
10
        }
11
        else {
11
        else {
12
            return null;
12
            return null;
13
        }
13
        }
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.2
Clones locationClones are declared in the same class
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)21.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (dataset != null)
    1
    if (dataset != null)
    2
    Range r = DatasetUtilities.findDomainBounds(dataset, false);
    2
    Range r = DatasetUtilities.findDomainBounds(dataset, false);
    2
    Range r = DatasetUtilities.findRangeBounds(dataset, false);
    Differences
    Expression1Expression2Difference
    findDomainBoundsfindRangeBoundsMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression DatasetUtilities.findDomainBounds(dataset,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression DatasetUtilities.findRangeBounds(dataset,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    Range r = DatasetUtilities.findRangeBounds(dataset, false);
    3
    if (r == null)
    3
    if (r == null)
    4
    return null;
    4
    return null;
    else
    else
    5
    return new Range(r.getLowerBound() + this.xOffset, r.getUpperBound() + this.blockWidth + this.xOffset);
    5
    return new Range(r.getLowerBound() + this.xOffset, r.getUpperBound() + this.blockWidth + this.xOffset);
    5
    return new Range(r.getLowerBound() + this.yOffset, r.getUpperBound() + this.blockHeight + this.yOffset);
    Differences
    Expression1Expression2Difference
    xOffsetyOffsetVARIABLE_NAME_MISMATCH
    xOffsetyOffsetVARIABLE_NAME_MISMATCH
    blockWidthblockHeightVARIABLE_NAME_MISMATCH
    5
    return new Range(r.getLowerBound() + this.yOffset, r.getUpperBound() + this.blockHeight + this.yOffset);
    else
    else
    6
    return null;
    6
    return null;
    Precondition Violations (2)
    Row Violation
    1Expression DatasetUtilities.findDomainBounds(dataset,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression DatasetUtilities.findRangeBounds(dataset,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted