344-2-3

DefaultCategoryDataset d = new DefaultCategoryDataset(); boolean pass = false; try { /* Number n =*/ d.getValue(0, 0); } catch (IndexOutOfBoundsException e) { pass = true; } assertTrue(pass);
DefaultKeyedValues2D d = new DefaultKeyedValues2D(); boolean pass = false; try { d.removeRow(0); } catch (IndexOutOfBoundsException e) { pass = true; } assertTrue(pass);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/category/junit/DefaultCategoryDatasetTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/junit/DefaultKeyedValues2DTests.java
Method name: `void testGetValue2()` |  | Method name: `void testRemoveRow()`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    DefaultCategoryDataset d = new DefaultCategoryDataset();↵

1

    DefaultKeyedValues2D d = new DefaultKeyedValues2D();↵

2

            boolean pass = false;↵

2

            boolean pass = false;↵

3

            try {↵

3

            try {↵

4

                /* Number n =*/ d.getValue(0, 0);↵

4

                d.removeRow(0);↵

5

            }↵

5

            }↵

6

            catch (IndexOutOfBoundsException e) {↵

6

            catch (IndexOutOfBoundsException e) {↵

7

                pass = true;↵

7

                pass = true;↵

8

            }↵

8

            }↵

9

            assertTrue(pass);

9

            assertTrue(pass);

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
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. {Refactorable}

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

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

   1

       DefaultKeyedValues2D d = new DefaultKeyedValues2D();

   1

       DefaultCategoryDataset d = new DefaultCategoryDataset();

   2

       boolean pass = false;

   2

       boolean pass = false;

   3

       try

   3

       try

   4

       d.removeRow(0);

   4

       d.getValue(0, 0);

   5

       assertTrue(pass);

   5

       assertTrue(pass);

   Precondition Violations (0)
   Row | Violation
   --- | ---