1619-1-2

DefaultKeyedValues2D d = new DefaultKeyedValues2D(); assertEquals(0, d.getRowCount()); d.addValue(new Double(1.0), "R1", "C1"); assertEquals(1, d.getRowCount()); d.addValue(new Double(2.0), "R2", "C1"); assertEquals(2, d.getRowCount());
DefaultKeyedValues2D d = new DefaultKeyedValues2D(); assertEquals(0, d.getColumnCount()); d.addValue(new Double(1.0), "R1", "C1"); assertEquals(1, d.getColumnCount()); d.addValue(new Double(2.0), "R1", "C2"); assertEquals(2, d.getColumnCount());

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/DefaultKeyedValues2DTests.java
Method name: `void testRowCount()` |  | Method name: `void testColumnCount()`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    DefaultKeyedValues2D d = new DefaultKeyedValues2D();↵

1

    DefaultKeyedValues2D d = new DefaultKeyedValues2D();↵

2

            assertEquals(0, d.getRowCount());↵

2

            assertEquals(0, d.getColumnCount());↵

3

            d.addValue(new Double(1.0), "R1", "C1");↵

3

            d.addValue(new Double(1.0), "R1", "C1");↵

4

            assertEquals(1, d.getRowCount());↵

4

            assertEquals(1, d.getColumnCount());↵

5

            d.addValue(new Double(2.0), "R2", "C1");↵

5

            d.addValue(new Double(2.0), "R1", "C2");↵

6

            assertEquals(2, d.getRowCount());

6

            assertEquals(2, d.getColumnCount());

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 declared in the same class
Number of node comparisons | 18

1. {Non-refactorable}

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

       DefaultKeyedValues2D d = new DefaultKeyedValues2D();

   1

       DefaultKeyedValues2D d = new DefaultKeyedValues2D();

   2

       assertEquals(0, d.getRowCount());

   2 | assertEquals(0, d.getRowCount());
   2 | assertEquals(0, d.getColumnCount());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getRowCount | getColumnCount | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression d.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted

   2

       assertEquals(0, d.getColumnCount());

   3

       d.addValue(new Double(1.0), "R1", "C1");

   3

       d.addValue(new Double(1.0), "R1", "C1");

   4

       assertEquals(1, d.getRowCount());

   4 | assertEquals(1, d.getRowCount());
   4 | assertEquals(1, d.getColumnCount());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getRowCount | getColumnCount | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression d.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted

   4

       assertEquals(1, d.getColumnCount());

   5

       d.addValue(new Double(2.0), "R2", "C1");

   5 | d.addValue(new Double(2.0), "R2", "C1");
   5 | d.addValue(new Double(2.0), "R1", "C2");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "R2" | "R1" | LITERAL_VALUE_MISMATCH
   "C1" | "C2" | LITERAL_VALUE_MISMATCH

   5

       d.addValue(new Double(2.0), "R1", "C2");

   6

       assertEquals(2, d.getRowCount());

   6 | assertEquals(2, d.getRowCount());
   6 | assertEquals(2, d.getColumnCount());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getRowCount | getColumnCount | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression d.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted

   6

       assertEquals(2, d.getColumnCount());

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Expression d.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression d.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression d.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted