347-1-2

YIntervalSeries s1 = new YIntervalSeries("S1"); assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount()); s1.setMaximumItemCount(2); assertEquals(2, s1.getMaximumItemCount()); s1.add(1.0, 1.1, 1.1, 1.1); s1.add(2.0, 2.2, 2.2, 2.2); s1.add(3.0, 3.3, 3.3, 3.3); assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON); assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
XIntervalSeries s1 = new XIntervalSeries("S1"); assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount()); s1.setMaximumItemCount(2); assertEquals(2, s1.getMaximumItemCount()); s1.add(1.0, 1.1, 1.1, 1.1); s1.add(2.0, 2.2, 2.2, 2.2); s1.add(3.0, 3.3, 3.3, 3.3); assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON); assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/YIntervalSeriesTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XIntervalSeriesTests.java
Method name: `void testSetMaximumItemCount()` |  | Method name: `void testSetMaximumItemCount()`
Number of AST nodes: 9 |  | Number of AST nodes: 9

1

    YIntervalSeries s1 = new YIntervalSeries("S1");↵

1

    XIntervalSeries s1 = new XIntervalSeries("S1");↵

2

            assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());↵

2

            assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());↵

3

            s1.setMaximumItemCount(2);↵

3

            s1.setMaximumItemCount(2);↵

4

            assertEquals(2, s1.getMaximumItemCount());↵

4

            assertEquals(2, s1.getMaximumItemCount());↵

5

            s1.add(1.0, 1.1, 1.1, 1.1);↵

5

            s1.add(1.0, 1.1, 1.1, 1.1);↵

6

            s1.add(2.0, 2.2, 2.2, 2.2);↵

6

            s1.add(2.0, 2.2, 2.2, 2.2);↵

7

            s1.add(3.0, 3.3, 3.3, 3.3);↵

7

            s1.add(3.0, 3.3, 3.3, 3.3);↵

8

            assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);↵

8

            assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);↵

9

            assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);

9

            assertEquals(3.0, s1.getX(1).doubleValue(), 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 in different classes having the same super class
Number of node comparisons | 41

1. {Refactorable}

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

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

   1

       YIntervalSeries s1 = new YIntervalSeries("S1");

   1

       XIntervalSeries s1 = new XIntervalSeries("S1");

   2

       assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());

   2

       assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());

   3

       s1.setMaximumItemCount(2);

   3

       s1.setMaximumItemCount(2);

   4

       assertEquals(2, s1.getMaximumItemCount());

   4

       assertEquals(2, s1.getMaximumItemCount());

   5

       s1.add(1.0, 1.1, 1.1, 1.1);

   5

       s1.add(1.0, 1.1, 1.1, 1.1);

   6

       s1.add(2.0, 2.2, 2.2, 2.2);

   6

       s1.add(2.0, 2.2, 2.2, 2.2);

   7

       s1.add(3.0, 3.3, 3.3, 3.3);

   7

       s1.add(3.0, 3.3, 3.3, 3.3);

   8

       assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);

   8

       assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);

   9

       assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);

   9

       assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);

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