int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); if (c != -1) { return this.underlying.getPercentComplete(r, c + this.firstCategoryIndex); } else { throw new UnknownKeyException("Unknown columnKey: " + columnKey); }
int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); if (c != -1) { return this.underlying.getSubIntervalCount(r, c + this.firstCategoryIndex); } else { throw new UnknownKeyException("Unknown columnKey: " + columnKey); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/SlidingGanttCategoryDataset.java File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/SlidingGanttCategoryDataset.java
Method name: Number getPercentComplete(Comparable, Comparable) Method name: int getSubIntervalCount(Comparable, Comparable)
Number of AST nodes: 5 Number of AST nodes: 5
1
int r = getRowIndex(rowKey);
1
int r = getRowIndex(rowKey);
2
		int c = getColumnIndex(columnKey);
2
		int c = getColumnIndex(columnKey);
3
		if (c != -1) {
3
		if (c != -1) {
4
            return this.underlying.getPercentComplete(r,
4
            return this.underlying.getSubIntervalCount(r,
5
            		c + this.firstCategoryIndex);
5
            		c + this.firstCategoryIndex);
6
		}
6
		}
7
		else {
7
		else {
8
			throw new UnknownKeyException("Unknown columnKey: " + columnKey);
8
			throw new UnknownKeyException("Unknown columnKey: " + columnKey);
9
		}
9
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)28.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int r = getRowIndex(rowKey);
    1
    int r = getRowIndex(rowKey);
    2
    int c = getColumnIndex(columnKey);
    2
    int c = getColumnIndex(columnKey);
    3
    if (c != -1)
    3
    if (c != -1)
    4
    return this.underlying.getPercentComplete(r, c + this.firstCategoryIndex);
    4
    return this.underlying.getPercentComplete(r, c + this.firstCategoryIndex);
    4
    return this.underlying.getSubIntervalCount(r, c + this.firstCategoryIndex);
    Differences
    Expression1Expression2Difference
    getPercentCompletegetSubIntervalCountMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.underlying.getPercentComplete(r,c + this.firstCategoryIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.underlying.getSubIntervalCount(r,c + this.firstCategoryIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return this.underlying.getSubIntervalCount(r, c + this.firstCategoryIndex);
    else
    else
    5
    throw new UnknownKeyException("Unknown columnKey: " + columnKey);
    5
    throw new UnknownKeyException("Unknown columnKey: " + columnKey);
    Precondition Violations (2)
    Row Violation
    1Expression this.underlying.getPercentComplete(r,c + this.firstCategoryIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.underlying.getSubIntervalCount(r,c + this.firstCategoryIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted