1445-1-2

XIntervalSeries s1 = new XIntervalSeries("Series 1", false, true); s1.add(1.0, 1.0, 1.0, 2.0); s1.add(3.0, 3.0, 3.0, 3.0); s1.add(2.0, 2.0, 2.0, 2.0); assertEquals(0, s1.indexOf(new Double(1.0))); assertEquals(1, s1.indexOf(new Double(3.0))); assertEquals(2, s1.indexOf(new Double(2.0)));
YIntervalSeries s1 = new YIntervalSeries("Series 1", false, true); s1.add(1.0, 1.0, 1.0, 2.0); s1.add(3.0, 3.0, 3.0, 3.0); s1.add(2.0, 2.0, 2.0, 2.0); assertEquals(0, s1.indexOf(new Double(1.0))); assertEquals(1, s1.indexOf(new Double(3.0))); assertEquals(2, s1.indexOf(new Double(2.0)));

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

1

    XIntervalSeries s1 = new XIntervalSeries("Series 1", false, true);↵

1

    YIntervalSeries s1 = new YIntervalSeries("Series 1", false, true);↵

2

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

2

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

3

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

3

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

4

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

4

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

5

            assertEquals(0, s1.indexOf(new Double(1.0)));↵

5

            assertEquals(0, s1.indexOf(new Double(1.0)));        ↵

6

            assertEquals(1, s1.indexOf(new Double(3.0)));↵

6

            assertEquals(1, s1.indexOf(new Double(3.0)));        ↵

7

            assertEquals(2, s1.indexOf(new Double(2.0)));

7

            assertEquals(2, s1.indexOf(new Double(2.0)));

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 | 25

1. {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) | 0.0
   Clone type | Type 1

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

   1

       XIntervalSeries s1 = new XIntervalSeries("Series 1", false, true);

   1

       YIntervalSeries s1 = new YIntervalSeries("Series 1", false, true);

   2

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

   2

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

   3

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

   3

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

   4

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

   4

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

   5

       assertEquals(0, s1.indexOf(new Double(1.0)));

   5

       assertEquals(0, s1.indexOf(new Double(1.0)));

   6

       assertEquals(1, s1.indexOf(new Double(3.0)));

   6

       assertEquals(1, s1.indexOf(new Double(3.0)));

   7

       assertEquals(2, s1.indexOf(new Double(2.0)));

   7

       assertEquals(2, s1.indexOf(new Double(2.0)));

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