382-1-2

DefaultKeyedValues2D d1 = new DefaultKeyedValues2D(); DefaultKeyedValues2D d2 = new DefaultKeyedValues2D(); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1.addValue(new Double(1.0), new Double(2.0), "S1"); assertFalse(d1.equals(d2)); d2.addValue(new Double(1.0), new Double(2.0), "S1"); assertTrue(d1.equals(d2));
KeyedObjects2D k1 = new KeyedObjects2D(); KeyedObjects2D k2 = new KeyedObjects2D(); assertTrue(k1.equals(k2)); assertTrue(k2.equals(k1)); k1.addObject(new Integer(99), "R1", "C1"); assertFalse(k1.equals(k2)); k2.addObject(new Integer(99), "R1", "C1"); assertTrue(k1.equals(k2));

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

1

    DefaultKeyedValues2D d1 = new DefaultKeyedValues2D();↵

1

    KeyedObjects2D k1 = new KeyedObjects2D();↵

2

            DefaultKeyedValues2D d2 = new DefaultKeyedValues2D();↵

2

            KeyedObjects2D k2 = new KeyedObjects2D();↵

3

            assertTrue(d1.equals(d2));↵

3

            assertTrue(k1.equals(k2));↵

4

            assertTrue(d2.equals(d1));↵

4

            assertTrue(k2.equals(k1));↵

5

            ↵

5

            ↵

6

            d1.addValue(new Double(1.0), new Double(2.0), "S1");↵

6

            k1.addObject(new Integer(99), "R1", "C1");↵

7

            assertFalse(d1.equals(d2));↵

7

            assertFalse(k1.equals(k2));↵

8

            d2.addValue(new Double(1.0), new Double(2.0), "S1");↵

8

            k2.addObject(new Integer(99), "R1", "C1");↵

9

            assertTrue(d1.equals(d2));

9

            assertTrue(k1.equals(k2));

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   Number of unmapped statements in the first code fragment | 3
   Number of unmapped statements in the second code fragment | 3
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

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

   1

       KeyedObjects2D k1 = new KeyedObjects2D();

   1

       DefaultKeyedValues2D d1 = new DefaultKeyedValues2D();

   2

       KeyedObjects2D k2 = new KeyedObjects2D();

   2

       DefaultKeyedValues2D d2 = new DefaultKeyedValues2D();

   3

       assertTrue(d1.equals(d2));

   3 | assertTrue(d1.equals(d2));
   3 | assertTrue(k1.equals(k2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d2 | k2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.data.KeyedObjects2D | VARIABLE_TYPE_MISMATCH
   d1 | k1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.data.KeyedObjects2D | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.DefaultKeyedValues2D of variable d2 does not match with type org.jfree.data.KeyedObjects2D of variable k2
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.data.KeyedObjects2D extend a common superclass

   Type org.jfree.data.DefaultKeyedValues2D of variable d1 does not match with type org.jfree.data.KeyedObjects2D of variable k1
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.data.KeyedObjects2D extend a common superclass

   3

       assertTrue(k1.equals(k2));

   4

       assertTrue(d2.equals(d1));

   4 | assertTrue(d2.equals(d1));
   4 | assertTrue(k2.equals(k1));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d1 | k1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.data.KeyedObjects2D | VARIABLE_TYPE_MISMATCH
   d2 | k2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.data.KeyedObjects2D | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.DefaultKeyedValues2D of variable d1 does not match with type org.jfree.data.KeyedObjects2D of variable k1
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.data.KeyedObjects2D extend a common superclass

   Type org.jfree.data.DefaultKeyedValues2D of variable d2 does not match with type org.jfree.data.KeyedObjects2D of variable k2
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.data.KeyedObjects2D extend a common superclass

   4

       assertTrue(k2.equals(k1));

   5

       d1.addValue(new Double(1.0), new Double(2.0), "S1");

   5 | d1.addValue(new Double(1.0), new Double(2.0), "S1");
   6 | assertFalse(k1.equals(k2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   addValue | assertFalse | METHOD_INVOCATION_NAME_MISMATCH
   d1.addValue(new Double(1.0),new Double(2.0),"S1") | assertFalse(k1.equals(k2)) | ARGUMENT_NUMBER_MISMATCH
   d1 |  | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertFalse(k1.equals(k2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") is a void method call, and thus it cannot be parameterized
   Expression assertFalse(k1.equals(k2)) is a void method call, and thus it cannot be parameterized
   Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertFalse(k1.equals(k2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") is a void method call, and thus it cannot be parameterized
   Expression assertFalse(k1.equals(k2)) is a void method call, and thus it cannot be parameterized

   6

       assertFalse(k1.equals(k2));

   6

       assertFalse(d1.equals(d2));

   6 | assertFalse(d1.equals(d2));
   5 | k1.addObject(new Integer(99), "R1", "C1");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertFalse | addObject | METHOD_INVOCATION_NAME_MISMATCH
   assertFalse(d1.equals(d2)) | k1.addObject(new Integer(99),"R1","C1") | ARGUMENT_NUMBER_MISMATCH
   | k1 | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression k1.addObject(new Integer(99),"R1","C1") 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 k1.addObject(new Integer(99),"R1","C1") is a void method call, and thus it cannot be parameterized
   Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression k1.addObject(new Integer(99),"R1","C1") 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 k1.addObject(new Integer(99),"R1","C1") is a void method call, and thus it cannot be parameterized

   5

       k1.addObject(new Integer(99), "R1", "C1");

   7 | k2.addObject(new Integer(99), "R1", "C1");

   Preondition Violations
   Unmatched statement k2.addObject(new Integer(99),"R1","C1"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   7

       k2.addObject(new Integer(99), "R1", "C1");

   7

       d2.addValue(new Double(1.0), new Double(2.0), "S1");

   7 | d2.addValue(new Double(1.0), new Double(2.0), "S1");

   Preondition Violations
   Unmatched statement d2.addValue(new Double(1.0),new Double(2.0),"S1"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   8

       assertTrue(d1.equals(d2));

   8 | assertTrue(d1.equals(d2));
   8 | assertTrue(k1.equals(k2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   d2 | k2 | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.data.KeyedObjects2D | VARIABLE_TYPE_MISMATCH
   d1 | k1 | VARIABLE_NAME_MISMATCH
   org.jfree.data.DefaultKeyedValues2D | org.jfree.data.KeyedObjects2D | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.DefaultKeyedValues2D of variable d2 does not match with type org.jfree.data.KeyedObjects2D of variable k2
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.data.KeyedObjects2D extend a common superclass

   Type org.jfree.data.DefaultKeyedValues2D of variable d1 does not match with type org.jfree.data.KeyedObjects2D of variable k1
   - Make classes org.jfree.data.DefaultKeyedValues2D and org.jfree.data.KeyedObjects2D extend a common superclass

   8

       assertTrue(k1.equals(k2));

   Precondition Violations (24)
   Row | Violation
   --- | ---
   1 | Type org.jfree.data.DefaultKeyedValues2D of variable d2 does not match with type org.jfree.data.KeyedObjects2D of variable k2
   2 | Type org.jfree.data.DefaultKeyedValues2D of variable d1 does not match with type org.jfree.data.KeyedObjects2D of variable k1
   3 | Type org.jfree.data.DefaultKeyedValues2D of variable d1 does not match with type org.jfree.data.KeyedObjects2D of variable k1
   4 | Type org.jfree.data.DefaultKeyedValues2D of variable d2 does not match with type org.jfree.data.KeyedObjects2D of variable k2
   5 | Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression assertFalse(k1.equals(k2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") is a void method call, and thus it cannot be parameterized
   8 | Expression assertFalse(k1.equals(k2)) is a void method call, and thus it cannot be parameterized
   9 | Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
   10 | Expression assertFalse(k1.equals(k2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   11 | Expression d1.addValue(new Double(1.0),new Double(2.0),"S1") is a void method call, and thus it cannot be parameterized
   12 | Expression assertFalse(k1.equals(k2)) is a void method call, and thus it cannot be parameterized
   13 | Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   14 | Expression k1.addObject(new Integer(99),"R1","C1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
   15 | Expression assertFalse(d1.equals(d2)) is a void method call, and thus it cannot be parameterized
   16 | Expression k1.addObject(new Integer(99),"R1","C1") is a void method call, and thus it cannot be parameterized
   17 | Expression assertFalse(d1.equals(d2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   18 | Expression k1.addObject(new Integer(99),"R1","C1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
   19 | Expression assertFalse(d1.equals(d2)) is a void method call, and thus it cannot be parameterized
   20 | Expression k1.addObject(new Integer(99),"R1","C1") is a void method call, and thus it cannot be parameterized
   21 | Unmatched statement k2.addObject(new Integer(99),"R1","C1"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   22 | Unmatched statement d2.addValue(new Double(1.0),new Double(2.0),"S1"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   23 | Type org.jfree.data.DefaultKeyedValues2D of variable d2 does not match with type org.jfree.data.KeyedObjects2D of variable k2
   24 | Type org.jfree.data.DefaultKeyedValues2D of variable d1 does not match with type org.jfree.data.KeyedObjects2D of variable k1