1122-1-2

DefaultIntervalXYDataset d1 = new DefaultIntervalXYDataset(); DefaultIntervalXYDataset d2 = new DefaultIntervalXYDataset(); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1 = createSampleDataset1(); assertFalse(d1.equals(d2)); d2 = createSampleDataset1(); assertTrue(d1.equals(d2));
DefaultWindDataset d1 = new DefaultWindDataset(); DefaultWindDataset d2 = new DefaultWindDataset(); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1 = createSampleDataset1(); assertFalse(d1.equals(d2)); d2 = createSampleDataset1(); assertTrue(d1.equals(d2));

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

1

    DefaultIntervalXYDataset d1 = new DefaultIntervalXYDataset();↵

1

    DefaultWindDataset d1 = new DefaultWindDataset();↵

2

            DefaultIntervalXYDataset d2 = new DefaultIntervalXYDataset();↵

2

            DefaultWindDataset d2 = new DefaultWindDataset();↵

3

            assertTrue(d1.equals(d2));↵

3

            assertTrue(d1.equals(d2));↵

4

            assertTrue(d2.equals(d1));↵

4

            assertTrue(d2.equals(d1));↵

5

            d1 = createSampleDataset1();↵

5

            d1 = createSampleDataset1();↵

6

            assertFalse(d1.equals(d2));↵

6

            assertFalse(d1.equals(d2));↵

7

            d2 = createSampleDataset1();↵

7

            d2 = createSampleDataset1();↵

8

            assertTrue(d1.equals(d2));

8

            assertTrue(d1.equals(d2));

See real code fragment |  | See real code fragment

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   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

       DefaultIntervalXYDataset d1 = new DefaultIntervalXYDataset();

   1

       DefaultWindDataset d1 = new DefaultWindDataset();

   2

       DefaultIntervalXYDataset d2 = new DefaultIntervalXYDataset();

   2

       DefaultWindDataset d2 = new DefaultWindDataset();

   3

       assertTrue(d1.equals(d2));

   3

       assertTrue(d1.equals(d2));

   4

       assertTrue(d2.equals(d1));

   4 | assertTrue(d2.equals(d1));
   6 | assertFalse(d1.equals(d2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertTrue | assertFalse | METHOD_INVOCATION_NAME_MISMATCH
   d1 | d2 | VARIABLE_NAME_MISMATCH
   d2 | d1 | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression assertTrue(d2.equals(d1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertTrue(d2.equals(d1)) is a void method call, and thus it cannot be parameterized
   Expression assertFalse(d1.equals(d2)) is a void method call, and thus it cannot be parameterized
   Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted

   6

       assertFalse(d1.equals(d2));

   5

       d1 = createSampleDataset1();

   5 | d1 = createSampleDataset1();
   7 | d2 = createSampleDataset1();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d1 | d2 | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted

   7

       d2 = createSampleDataset1();

   6

       assertFalse(d1.equals(d2));

   6 | assertFalse(d1.equals(d2));
   4 | assertTrue(d2.equals(d1));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertFalse | assertTrue | METHOD_INVOCATION_NAME_MISMATCH
   d2 | d1 | VARIABLE_NAME_MISMATCH
   d1 | d2 | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertTrue(d2.equals(d1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertFalse(d1.equals(d2)) is a void method call, and thus it cannot be parameterized
   Expression assertTrue(d2.equals(d1)) is a void method call, and thus it cannot be parameterized
   Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted

   4

       assertTrue(d2.equals(d1));

   7

       d2 = createSampleDataset1();

   7 | d2 = createSampleDataset1();
   5 | d1 = createSampleDataset1();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d2 | d1 | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted

   5

       d1 = createSampleDataset1();

   8

       assertTrue(d1.equals(d2));

   8

       assertTrue(d1.equals(d2));

   Precondition Violations (20)
   Row | Violation
   --- | ---
   1 | Expression assertTrue(d2.equals(d1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression assertTrue(d2.equals(d1)) is a void method call, and thus it cannot be parameterized
   4 | Expression assertFalse(d1.equals(d2)) is a void method call, and thus it cannot be parameterized
   5 | Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   9 | Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   10 | Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   11 | Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   12 | Expression assertTrue(d2.equals(d1)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   13 | Expression assertFalse(d1.equals(d2)) is a void method call, and thus it cannot be parameterized
   14 | Expression assertTrue(d2.equals(d1)) is a void method call, and thus it cannot be parameterized
   15 | Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   16 | Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   17 | Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   18 | Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   19 | Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
   20 | Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted