1676-2-4

double[][] data = createSampleData1(); double[] result = Regression.getPowerRegression(data); assertEquals(0.91045813, result[0], 0.0000001); assertEquals(0.88918346, result[1], 0.0000001);
double[][] data = createSampleData2(); double[] result = Regression.getPowerRegression(data); assertEquals(106.1241681, result[0], 0.0000001); assertEquals(-0.8466615, result[1], 0.0000001);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/statistics/junit/RegressionTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/statistics/junit/RegressionTests.java
Method name: `void testPowerRegression1a()` |  | Method name: `void testPowerRegression2a()`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    double[][] data = createSampleData1();↵

1

    double[][] data = createSampleData2();↵

2

            double[] result = Regression.getPowerRegression(data);↵

2

            double[] result = Regression.getPowerRegression(data);↵

3

            assertEquals(0.91045813, result[0], 0.0000001);↵

3

            assertEquals(106.1241681, result[0], 0.0000001);↵

4

            assertEquals(0.88918346, result[1], 0.0000001);

4

            assertEquals(-0.8466615, result[1], 0.0000001);

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

1. {Refactorable}

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

       double[][] data = createSampleData1();

   1 | double[][] data = createSampleData1();
   1 | double[][] data = createSampleData2();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   createSampleData1 | createSampleData2 | METHOD_INVOCATION_NAME_MISMATCH

   1

       double[][] data = createSampleData2();

   2

       double[] result = Regression.getPowerRegression(data);

   2

       double[] result = Regression.getPowerRegression(data);

   3

       assertEquals(0.91045813, result[0], 0.0000001);

   3 | assertEquals(0.91045813, result[0], 0.0000001);
   3 | assertEquals(106.1241681, result[0], 0.0000001);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   0.91045813 | 106.1241681 | LITERAL_VALUE_MISMATCH

   3

       assertEquals(106.1241681, result[0], 0.0000001);

   4

       assertEquals(0.88918346, result[1], 0.0000001);

   4 | assertEquals(0.88918346, result[1], 0.0000001);
   4 | assertEquals(-0.8466615, result[1], 0.0000001);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   0.88918346 | -0.8466615 | TYPE_COMPATIBLE_REPLACEMENT

   4

       assertEquals(-0.8466615, result[1], 0.0000001);

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