384-5-9

int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); if (c != -1) { return this.underlying.getStartValue(r, c + this.firstCategoryIndex, subinterval); } else { throw new UnknownKeyException("Unknown columnKey: " + columnKey); }
int r = getRowIndex(rowKey); int c = getColumnIndex(columnKey); if (c != -1) { return this.underlying.getValue(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/category/SlidingCategoryDataset.java
Method name: `Number getStartValue(Comparable, Comparable, int)` |  | Method name: `Number getValue(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.getStartValue(r,↵

4

                return this.underlying.getValue(r,↵

5

                		c + this.firstCategoryIndex, subinterval);↵

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

    		}

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 13

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 1.0
   Clone type | Type 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.getValue(r, c + this.firstCategoryIndex);

   Preondition Violations
   Unmatched statement return this.underlying.getValue(r,c + this.firstCategoryIndex); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   Unmatched return this.underlying.getValue(r,c + this.firstCategoryIndex);

   4

       return this.underlying.getValue(r, c + this.firstCategoryIndex);

   4

       return this.underlying.getStartValue(r, c + this.firstCategoryIndex, subinterval);

   4 | return this.underlying.getStartValue(r, c + this.firstCategoryIndex, subinterval);

   Preondition Violations
   Unmatched statement return this.underlying.getStartValue(r,c + this.firstCategoryIndex,subinterval); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   Unmatched return this.underlying.getStartValue(r,c + this.firstCategoryIndex,subinterval);

       else

       else

   5

       throw new UnknownKeyException("Unknown columnKey: " + columnKey);

   5

       throw new UnknownKeyException("Unknown columnKey: " + columnKey);

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Unmatched statement return this.underlying.getValue(r,c + this.firstCategoryIndex); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   2 | Unmatched return this.underlying.getValue(r,c + this.firstCategoryIndex);
   3 | Unmatched statement return this.underlying.getStartValue(r,c + this.firstCategoryIndex,subinterval); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched return this.underlying.getStartValue(r,c + this.firstCategoryIndex,subinterval);
   5 | Clone fragment #1 returns variables r, c , while Clone fragment #2 returns variables r, c