1737-1-2

CategoryDataset dataset = createCategoryDataset1(); Range r = DatasetUtilities.iterateRangeBounds(dataset, false); assertEquals(1.0, r.getLowerBound(), EPSILON); assertEquals(6.0, r.getUpperBound(), EPSILON);
TableXYDataset d2 = createTableXYDataset1(); Range r = DatasetUtilities.findStackedRangeBounds(d2); assertEquals(-2.0, r.getLowerBound(), EPSILON); assertEquals(2.0, r.getUpperBound(), EPSILON);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java
Method name: `void testIterateRangeBounds_CategoryDataset()` |  | Method name: `void testFindStackedRangeBoundsForTableXYDataset1()`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    CategoryDataset dataset = createCategoryDataset1();↵

1

    TableXYDataset d2 = createTableXYDataset1();↵

2

            Range r = DatasetUtilities.iterateRangeBounds(dataset, false);↵

2

            Range r = DatasetUtilities.findStackedRangeBounds(d2);↵

3

            assertEquals(1.0, r.getLowerBound(), EPSILON);↵

3

            assertEquals(-2.0, r.getLowerBound(), EPSILON);↵

4

            assertEquals(6.0, r.getUpperBound(), EPSILON);

4

            assertEquals(2.0, r.getUpperBound(), EPSILON);

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 3
   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) | 0.0
   Clone type | Type 2

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

   1

       TableXYDataset d2 = createTableXYDataset1();

   1

       CategoryDataset dataset = createCategoryDataset1();

   2

       Range r = DatasetUtilities.iterateRangeBounds(dataset, false);

   2 | Range r = DatasetUtilities.iterateRangeBounds(dataset, false);
   2 | Range r = DatasetUtilities.findStackedRangeBounds(d2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   iterateRangeBounds | findStackedRangeBounds | METHOD_INVOCATION_NAME_MISMATCH
   DatasetUtilities.iterateRangeBounds(dataset,false) | DatasetUtilities.findStackedRangeBounds(d2) | ARGUMENT_NUMBER_MISMATCH

   2

       Range r = DatasetUtilities.findStackedRangeBounds(d2);

   3

       assertEquals(1.0, r.getLowerBound(), EPSILON);

   3 | assertEquals(1.0, r.getLowerBound(), EPSILON);
   3 | assertEquals(-2.0, r.getLowerBound(), EPSILON);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   1.0 | -2.0 | TYPE_COMPATIBLE_REPLACEMENT

   3

       assertEquals(-2.0, r.getLowerBound(), EPSILON);

   4

       assertEquals(6.0, r.getUpperBound(), EPSILON);

   4 | assertEquals(6.0, r.getUpperBound(), EPSILON);
   4 | assertEquals(2.0, r.getUpperBound(), EPSILON);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   6.0 | 2.0 | LITERAL_VALUE_MISMATCH

   4

       assertEquals(2.0, r.getUpperBound(), EPSILON);

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