BarRenderer r = new BarRenderer(); assertEquals(Color.blue, r.getBasePaint()); // first check that autoPopulate==false works as expected r.setAutoPopulateSeriesPaint(false); assertEquals(Color.blue, r.lookupSeriesPaint(0)); assertNull(r.getSeriesPaint(0)); // now check autoPopulate==true r.setAutoPopulateSeriesPaint(true); /*CategoryPlot plot =*/ new CategoryPlot(null, new CategoryAxis( "Category"), new NumberAxis("Value"), r); assertEquals(DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[0], r.lookupSeriesPaint(0)); assertNotNull(r.getSeriesPaint(0));
BarRenderer r = new BarRenderer(); assertEquals(Color.white, r.getBaseFillPaint()); // first check that autoPopulate==false works as expected r.setAutoPopulateSeriesFillPaint(false); assertEquals(Color.white, r.lookupSeriesFillPaint(0)); assertNull(r.getSeriesFillPaint(0)); // now check autoPopulate==true r.setAutoPopulateSeriesFillPaint(true); /*CategoryPlot plot =*/ new CategoryPlot(null, new CategoryAxis( "Category"), new NumberAxis("Value"), r); assertEquals(DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE[0], r.lookupSeriesFillPaint(0)); assertNotNull(r.getSeriesFillPaint(0));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/junit/AbstractRendererTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/junit/AbstractRendererTests.java
Method name: void testPaintLookup() Method name: void testFillPaintLookup()
Number of AST nodes: 9 Number of AST nodes: 9
1
BarRenderer r = new BarRenderer();
1
BarRenderer r = new BarRenderer();
2
        assertEquals(Color.blue, r.getBasePaint());
2
        assertEquals(Color.white, r.getBaseFillPaint());
3
        
3
        
4
        // first check that autoPopulate==false works as expected
4
        // first check that autoPopulate==false works as expected
5
        r.setAutoPopulateSeriesPaint(false);
5
        r.setAutoPopulateSeriesFillPaint(false);
6
        assertEquals(Color.blue, r.lookupSeriesPaint(0));
6
        assertEquals(Color.white, r.lookupSeriesFillPaint(0));
7
        assertNull(r.getSeriesPaint(0));
7
        assertNull(r.getSeriesFillPaint(0));
8
        
8
        
9
        // now check autoPopulate==true
9
        // now check autoPopulate==true
10
        r.setAutoPopulateSeriesPaint(true);
10
        r.setAutoPopulateSeriesFillPaint(true);
11
        /*CategoryPlot plot =*/ new CategoryPlot(null, new CategoryAxis(
11
        /*CategoryPlot plot =*/ new CategoryPlot(null, new CategoryAxis(
12
                "Category"), new NumberAxis("Value"), r);
12
                "Category"), new NumberAxis("Value"), r);
13
        assertEquals(DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[0], 
13
        assertEquals(DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE[0], 
14
                r.lookupSeriesPaint(0));
14
                r.lookupSeriesFillPaint(0));
15
        assertNotNull(r.getSeriesPaint(0));
15
        assertNotNull(r.getSeriesFillPaint(0));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons41
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    BarRenderer r = new BarRenderer();
    1
    BarRenderer r = new BarRenderer();
    2
    assertEquals(Color.blue, r.getBasePaint());
    2
    assertEquals(Color.blue, r.getBasePaint());
    2
    assertEquals(Color.white, r.getBaseFillPaint());
    Differences
    Expression1Expression2Difference
    bluewhiteVARIABLE_NAME_MISMATCH
    getBasePaintgetBaseFillPaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.getBasePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.getBaseFillPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    assertEquals(Color.white, r.getBaseFillPaint());
    3
    r.setAutoPopulateSeriesPaint(false);
    3
    r.setAutoPopulateSeriesPaint(false);
    3
    r.setAutoPopulateSeriesFillPaint(false);
    Differences
    Expression1Expression2Difference
    setAutoPopulateSeriesPaintsetAutoPopulateSeriesFillPaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.setAutoPopulateSeriesPaint(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.setAutoPopulateSeriesFillPaint(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.setAutoPopulateSeriesPaint(false) is a void method call, and thus it cannot be parameterized
    Expression r.setAutoPopulateSeriesFillPaint(false) is a void method call, and thus it cannot be parameterized
    3
    r.setAutoPopulateSeriesFillPaint(false);
    4
    assertEquals(Color.blue, r.lookupSeriesPaint(0));
    4
    assertEquals(Color.blue, r.lookupSeriesPaint(0));
    4
    assertEquals(Color.white, r.lookupSeriesFillPaint(0));
    Differences
    Expression1Expression2Difference
    bluewhiteVARIABLE_NAME_MISMATCH
    lookupSeriesPaintlookupSeriesFillPaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.lookupSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.lookupSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    assertEquals(Color.white, r.lookupSeriesFillPaint(0));
    5
    assertNull(r.getSeriesPaint(0));
    5
    assertNull(r.getSeriesPaint(0));
    5
    assertNull(r.getSeriesFillPaint(0));
    Differences
    Expression1Expression2Difference
    getSeriesPaintgetSeriesFillPaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.getSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.getSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    assertNull(r.getSeriesFillPaint(0));
    6
    r.setAutoPopulateSeriesPaint(true);
    6
    r.setAutoPopulateSeriesPaint(true);
    6
    r.setAutoPopulateSeriesFillPaint(true);
    Differences
    Expression1Expression2Difference
    setAutoPopulateSeriesPaintsetAutoPopulateSeriesFillPaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.setAutoPopulateSeriesPaint(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.setAutoPopulateSeriesFillPaint(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.setAutoPopulateSeriesPaint(true) is a void method call, and thus it cannot be parameterized
    Expression r.setAutoPopulateSeriesFillPaint(true) is a void method call, and thus it cannot be parameterized
    6
    r.setAutoPopulateSeriesFillPaint(true);
    7
    new CategoryPlot(null, new CategoryAxis("Category"), new NumberAxis("Value"), r);
    7
    new CategoryPlot(null, new CategoryAxis("Category"), new NumberAxis("Value"), r);
    8
    assertEquals(DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[0], r.lookupSeriesPaint(0));
    8
    assertEquals(DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE[0], r.lookupSeriesPaint(0));
    8
    assertEquals(DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE[0], r.lookupSeriesFillPaint(0));
    Differences
    Expression1Expression2Difference
    DEFAULT_PAINT_SEQUENCEDEFAULT_FILL_PAINT_SEQUENCEVARIABLE_NAME_MISMATCH
    lookupSeriesPaintlookupSeriesFillPaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.lookupSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.lookupSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    assertEquals(DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE[0], r.lookupSeriesFillPaint(0));
    9
    assertNotNull(r.getSeriesPaint(0));
    9
    assertNotNull(r.getSeriesPaint(0));
    9
    assertNotNull(r.getSeriesFillPaint(0));
    Differences
    Expression1Expression2Difference
    getSeriesPaintgetSeriesFillPaintMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.getSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.getSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    assertNotNull(r.getSeriesFillPaint(0));
    Precondition Violations (18)
    Row Violation
    1Expression r.getBasePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression r.getBaseFillPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression r.setAutoPopulateSeriesPaint(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression r.setAutoPopulateSeriesFillPaint(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression r.setAutoPopulateSeriesPaint(false) is a void method call, and thus it cannot be parameterized
    6Expression r.setAutoPopulateSeriesFillPaint(false) is a void method call, and thus it cannot be parameterized
    7Expression r.lookupSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression r.lookupSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression r.getSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression r.getSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression r.setAutoPopulateSeriesPaint(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression r.setAutoPopulateSeriesFillPaint(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression r.setAutoPopulateSeriesPaint(true) is a void method call, and thus it cannot be parameterized
    14Expression r.setAutoPopulateSeriesFillPaint(true) is a void method call, and thus it cannot be parameterized
    15Expression r.lookupSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression r.lookupSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression r.getSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression r.getSeriesFillPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted