1116-1-3

int seriesIndex = getSeriesIndex(series); if (seriesIndex < 0) { throw new UnknownKeyException("Unknown 'series' key."); } int itemIndex = getColumnIndex(category); if (itemIndex < 0) { throw new UnknownKeyException("Unknown 'category' key."); } return getValue(seriesIndex, itemIndex);
int seriesIndex = getSeriesIndex(series); if (seriesIndex < 0) { throw new UnknownKeyException("Unknown 'series' key."); } int itemIndex = getColumnIndex(category); if (itemIndex < 0) { throw new UnknownKeyException("Unknown 'category' key."); } return getEndValue(seriesIndex, itemIndex);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/category/DefaultIntervalCategoryDataset.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/category/DefaultIntervalCategoryDataset.java
Method name: `Number getValue(Comparable, Comparable)` |  | Method name: `Number getEndValue(Comparable, Comparable)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    int seriesIndex = getSeriesIndex(series);↵

1

    int seriesIndex = getSeriesIndex(series);↵

2

            if (seriesIndex < 0) {↵

2

            if (seriesIndex < 0) {↵

3

                throw new UnknownKeyException("Unknown 'series' key.");↵

3

                throw new UnknownKeyException("Unknown 'series' key.");↵

4

            }↵

4

            }↵

5

            int itemIndex = getColumnIndex(category);↵

5

            int itemIndex = getColumnIndex(category);↵

6

            if (itemIndex < 0) {↵

6

            if (itemIndex < 0) {↵

7

                throw new UnknownKeyException("Unknown 'category' key.");↵

7

                throw new UnknownKeyException("Unknown 'category' key.");↵

8

            }↵

8

            }↵

9

            return getValue(seriesIndex, itemIndex);

9

            return getEndValue(seriesIndex, itemIndex);

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.2
Clones location | Clones are declared in the same class
Number of node comparisons | 22

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 1.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       int seriesIndex = getSeriesIndex(series);

   1

       int seriesIndex = getSeriesIndex(series);

   2

       if (seriesIndex < 0)

   2

       if (seriesIndex < 0)

   3

       throw new UnknownKeyException("Unknown 'series' key.");

   3

       throw new UnknownKeyException("Unknown 'series' key.");

   4

       int itemIndex = getColumnIndex(category);

   4

       int itemIndex = getColumnIndex(category);

   5

       if (itemIndex < 0)

   5

       if (itemIndex < 0)

   6

       throw new UnknownKeyException("Unknown 'category' key.");

   6

       throw new UnknownKeyException("Unknown 'category' key.");

   7

       return getValue(seriesIndex, itemIndex);

   7 | return getValue(seriesIndex, itemIndex);
   7 | return getEndValue(seriesIndex, itemIndex);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getValue | getEndValue | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression getValue(seriesIndex,itemIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression getEndValue(seriesIndex,itemIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   7

       return getEndValue(seriesIndex, itemIndex);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression getValue(seriesIndex,itemIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression getEndValue(seriesIndex,itemIndex) cannot be parameterized, because it has dependencies to/from statements that will be extracted