1475-3-4

DefaultWindDataset d = createSampleDataset1(); assertEquals(0, d.indexOf("Series 1")); assertEquals(1, d.indexOf("Series 2")); assertEquals(-1, d.indexOf("Green Eggs and Ham")); assertEquals(-1, d.indexOf(null));
DefaultXYDataset d = createSampleDataset1(); assertEquals(0, d.indexOf("S1")); assertEquals(1, d.indexOf("S2")); assertEquals(-1, d.indexOf("Green Eggs and Ham")); assertEquals(-1, d.indexOf(null));

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

1

    DefaultWindDataset d = createSampleDataset1();↵

1

    DefaultXYDataset d = createSampleDataset1();↵

2

            assertEquals(0, d.indexOf("Series 1"));↵

2

            assertEquals(0, d.indexOf("S1"));↵

3

            assertEquals(1, d.indexOf("Series 2"));↵

3

            assertEquals(1, d.indexOf("S2"));↵

4

            assertEquals(-1, d.indexOf("Green Eggs and Ham"));↵

4

            assertEquals(-1, d.indexOf("Green Eggs and Ham"));↵

5

            assertEquals(-1, d.indexOf(null));

5

            assertEquals(-1, d.indexOf(null));

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 | 5
   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 2

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

   1

       DefaultWindDataset d = createSampleDataset1();

   1 | DefaultWindDataset d = createSampleDataset1();
   1 | DefaultXYDataset d = createSampleDataset1();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultWindDataset | org.jfree.data.xy.DefaultXYDataset | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.DefaultWindDataset | org.jfree.data.xy.DefaultXYDataset | SUBCLASS_TYPE_MISMATCH

   1

       DefaultXYDataset d = createSampleDataset1();

   2

       assertEquals(0, d.indexOf("Series 1"));

   2 | assertEquals(0, d.indexOf("Series 1"));
   2 | assertEquals(0, d.indexOf("S1"));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "Series 1" | "S1" | LITERAL_VALUE_MISMATCH
   org.jfree.data.xy.DefaultWindDataset | org.jfree.data.xy.DefaultXYDataset | SUBCLASS_TYPE_MISMATCH

   2

       assertEquals(0, d.indexOf("S1"));

   3

       assertEquals(1, d.indexOf("Series 2"));

   3 | assertEquals(1, d.indexOf("Series 2"));
   3 | assertEquals(1, d.indexOf("S2"));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "Series 2" | "S2" | LITERAL_VALUE_MISMATCH
   org.jfree.data.xy.DefaultWindDataset | org.jfree.data.xy.DefaultXYDataset | SUBCLASS_TYPE_MISMATCH

   3

       assertEquals(1, d.indexOf("S2"));

   4

       assertEquals(-1, d.indexOf("Green Eggs and Ham"));

   4 | assertEquals(-1, d.indexOf("Green Eggs and Ham"));
   4 | assertEquals(-1, d.indexOf("Green Eggs and Ham"));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultWindDataset | org.jfree.data.xy.DefaultXYDataset | SUBCLASS_TYPE_MISMATCH

   4

       assertEquals(-1, d.indexOf("Green Eggs and Ham"));

   5

       assertEquals(-1, d.indexOf(null));

   5 | assertEquals(-1, d.indexOf(null));
   5 | assertEquals(-1, d.indexOf(null));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.DefaultWindDataset | org.jfree.data.xy.DefaultXYDataset | SUBCLASS_TYPE_MISMATCH

   5

       assertEquals(-1, d.indexOf(null));

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