1007-3-7

CandlestickRenderer r1 = new CandlestickRenderer(); // check defaults assertEquals(Color.green, r1.getUpPaint()); assertEquals(Color.red, r1.getDownPaint()); assertFalse(r1.getUseOutlinePaint()); assertTrue(r1.getDrawVolume()); assertEquals(Color.gray, r1.getVolumePaint()); assertEquals(-1.0, r1.getCandleWidth(), EPSILON);
CustomPieURLGenerator g1 = new CustomPieURLGenerator(); CustomPieURLGenerator g2 = new CustomPieURLGenerator(); assertTrue(g1.equals(g2)); Map m1 = new HashMap(); m1.put("A", "http://www.jfree.org/"); g1.addURLs(m1); assertFalse(g1.equals(g2)); g2.addURLs(m1); assertTrue(g1.equals(g2));

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/CandlestickRendererTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/urls/junit/CustomPieURLGeneratorTests.java
Method name: `void testConstructor()` |  | Method name: `void testEquals()`
Number of AST nodes: 7 |  | Number of AST nodes: 9

1

    CandlestickRenderer r1 = new CandlestickRenderer();↵

1

    CustomPieURLGenerator g1 = new CustomPieURLGenerator();↵

2

            // check defaults↵

2

            ↵

3

            assertEquals(Color.green, r1.getUpPaint(↵

3

    CustomPieURLGenerator g2 = new CustomPieURLGenerator();↵

4

    ));↵

4

            assertTrue(g1.equals(g2));↵

5

            assertEquals(Color.red, r1.getDownPaint());↵

5

            ↵

6

            assertFalse(r1.getUseOutlinePaint()↵

6

    Map m1 = new HashMap();↵

7

            m1.put("A", "http://www.jfree.org/");↵

7

    );↵

8

            g1.addURLs(m1);↵

8

            assertTrue(r1.getDrawVolume());↵

9

            assertFalse(g1.↵

9

            assertEquals(Color.gray, r1.getVolumePaint()↵

10

    equals(g2));↵

10

    );↵

11

            g2.addURLs(m1);↵

11

            assertEquals(-1.0, r1.getCandleWidth(), EPSILON);

12

            assertTrue(g1.equals(g2));

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

1. {Non-refactorable}

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

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

   1

       CustomPieURLGenerator g1 = new CustomPieURLGenerator();

   1

       CandlestickRenderer r1 = new CandlestickRenderer();

   2

       CustomPieURLGenerator g2 = new CustomPieURLGenerator();

   2

       assertEquals(Color.green, r1.getUpPaint());

   2 | assertEquals(Color.green, r1.getUpPaint());
   9 | assertTrue(g1.equals(g2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertEquals | assertTrue | METHOD_INVOCATION_NAME_MISMATCH
   assertEquals(Color.green,r1.getUpPaint()) | assertTrue(g1.equals(g2)) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression assertTrue(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(Color.green,r1.getUpPaint()) is a void method call, and thus it cannot be parameterized
   Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   Expression assertTrue(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(Color.green,r1.getUpPaint()) is a void method call, and thus it cannot be parameterized
   Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized

   9

       assertTrue(g1.equals(g2));

   3

       assertEquals(Color.red, r1.getDownPaint());

   3 | assertEquals(Color.red, r1.getDownPaint());
   3 | assertTrue(g1.equals(g2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertEquals | assertTrue | METHOD_INVOCATION_NAME_MISMATCH
   assertEquals(Color.red,r1.getDownPaint()) | assertTrue(g1.equals(g2)) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression assertEquals(Color.red,r1.getDownPaint()) is a void method call, and thus it cannot be parameterized
   Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   Expression assertEquals(Color.red,r1.getDownPaint()) is a void method call, and thus it cannot be parameterized
   Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized

   3

       assertTrue(g1.equals(g2));

   4

       Map m1 = new HashMap();

   4

       assertFalse(r1.getUseOutlinePaint());

   5

       m1.put("A", "http://www.jfree.org/");

   5

       assertTrue(r1.getDrawVolume());

   6

       assertEquals(Color.gray, r1.getVolumePaint());

   6 | assertEquals(Color.gray, r1.getVolumePaint());
   7 | assertFalse(g1.equals(g2));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertEquals | assertFalse | METHOD_INVOCATION_NAME_MISMATCH
   assertEquals(Color.gray,r1.getVolumePaint()) | assertFalse(g1.equals(g2)) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression assertFalse(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(Color.gray,r1.getVolumePaint()) is a void method call, and thus it cannot be parameterized
   Expression assertFalse(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   Expression assertFalse(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(Color.gray,r1.getVolumePaint()) is a void method call, and thus it cannot be parameterized
   Expression assertFalse(g1.equals(g2)) is a void method call, and thus it cannot be parameterized

   7

       assertFalse(g1.equals(g2));

   7

       assertEquals(-1.0, r1.getCandleWidth(), EPSILON);

   7 | assertEquals(-1.0, r1.getCandleWidth(), EPSILON);
   6 | g1.addURLs(m1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   assertEquals | addURLs | METHOD_INVOCATION_NAME_MISMATCH
   assertEquals(-1.0,r1.getCandleWidth(),EPSILON) | g1.addURLs(m1) | ARGUMENT_NUMBER_MISMATCH
   | g1 | MISSING_METHOD_INVOCATION_EXPRESSION

   Preondition Violations
   Expression g1.addURLs(m1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(-1.0,r1.getCandleWidth(),EPSILON) is a void method call, and thus it cannot be parameterized
   Expression g1.addURLs(m1) is a void method call, and thus it cannot be parameterized
   Expression g1.addURLs(m1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression assertEquals(-1.0,r1.getCandleWidth(),EPSILON) is a void method call, and thus it cannot be parameterized
   Expression g1.addURLs(m1) is a void method call, and thus it cannot be parameterized

   6

       g1.addURLs(m1);

   8

       g2.addURLs(m1);

   Precondition Violations (22)
   Row | Violation
   --- | ---
   1 | Expression assertTrue(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression assertEquals(Color.green,r1.getUpPaint()) is a void method call, and thus it cannot be parameterized
   3 | Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   4 | Expression assertTrue(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression assertEquals(Color.green,r1.getUpPaint()) is a void method call, and thus it cannot be parameterized
   6 | Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   7 | Expression assertEquals(Color.red,r1.getDownPaint()) is a void method call, and thus it cannot be parameterized
   8 | Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   9 | Expression assertEquals(Color.red,r1.getDownPaint()) is a void method call, and thus it cannot be parameterized
   10 | Expression assertTrue(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   11 | Expression assertFalse(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   12 | Expression assertEquals(Color.gray,r1.getVolumePaint()) is a void method call, and thus it cannot be parameterized
   13 | Expression assertFalse(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   14 | Expression assertFalse(g1.equals(g2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   15 | Expression assertEquals(Color.gray,r1.getVolumePaint()) is a void method call, and thus it cannot be parameterized
   16 | Expression assertFalse(g1.equals(g2)) is a void method call, and thus it cannot be parameterized
   17 | Expression g1.addURLs(m1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   18 | Expression assertEquals(-1.0,r1.getCandleWidth(),EPSILON) is a void method call, and thus it cannot be parameterized
   19 | Expression g1.addURLs(m1) is a void method call, and thus it cannot be parameterized
   20 | Expression g1.addURLs(m1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   21 | Expression assertEquals(-1.0,r1.getCandleWidth(),EPSILON) is a void method call, and thus it cannot be parameterized
   22 | Expression g1.addURLs(m1) is a void method call, and thus it cannot be parameterized