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.gray, r.getBaseOutlinePaint()); // first check that autoPopulate==false works as expected r.setAutoPopulateSeriesOutlinePaint(false); assertEquals(Color.gray, r.lookupSeriesOutlinePaint(0)); assertNull(r.getSeriesOutlinePaint(0)); // now check autoPopulate==true r.setAutoPopulateSeriesOutlinePaint(true); /*CategoryPlot plot =*/ new CategoryPlot(null, new CategoryAxis( "Category"), new NumberAxis("Value"), r); assertEquals(DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE[0], r.lookupSeriesOutlinePaint(0)); assertNotNull(r.getSeriesOutlinePaint(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 testOutlinePaintLookup()
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.gray, r.getBaseOutlinePaint());
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.setAutoPopulateSeriesOutlinePaint(false);
6
        assertEquals(Color.blue, r.lookupSeriesPaint(0));
6
        assertEquals(Color.gray, r.lookupSeriesOutlinePaint(0));
7
        assertNull(r.getSeriesPaint(0));
7
        assertNull(r.getSeriesOutlinePaint(0));
8
        
8
        
9
        // now check autoPopulate==true
9
        // now check autoPopulate==true
10
        r.setAutoPopulateSeriesPaint(true);
10
        r.setAutoPopulateSeriesOutlinePaint(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_OUTLINE_PAINT_SEQUENCE[0], 
14
                r.lookupSeriesPaint(0));
14
                r.lookupSeriesOutlinePaint(0));
15
        assertNotNull(r.getSeriesPaint(0));
15
        assertNotNull(r.getSeriesOutlinePaint(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());
    5
    assertNull(r.getSeriesOutlinePaint(0));
    Differences
    Expression1Expression2Difference
    assertEqualsassertNullMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals(Color.blue,r.getBasePaint())assertNull(r.getSeriesOutlinePaint(0))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(Color.blue,r.getBasePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(r.getSeriesOutlinePaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(Color.blue,r.getBasePaint()) is a void method call, and thus it cannot be parameterized
    Expression assertNull(r.getSeriesOutlinePaint(0)) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(Color.blue,r.getBasePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(r.getSeriesOutlinePaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(Color.blue,r.getBasePaint()) is a void method call, and thus it cannot be parameterized
    Expression assertNull(r.getSeriesOutlinePaint(0)) is a void method call, and thus it cannot be parameterized
    5
    assertNull(r.getSeriesOutlinePaint(0));
    3
    r.setAutoPopulateSeriesPaint(false);
    3
    r.setAutoPopulateSeriesPaint(false);
    3
    r.setAutoPopulateSeriesOutlinePaint(false);
    Differences
    Expression1Expression2Difference
    setAutoPopulateSeriesPaintsetAutoPopulateSeriesOutlinePaintMETHOD_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.setAutoPopulateSeriesOutlinePaint(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.setAutoPopulateSeriesOutlinePaint(false) is a void method call, and thus it cannot be parameterized
    3
    r.setAutoPopulateSeriesOutlinePaint(false);
    4
    assertEquals(Color.blue, r.lookupSeriesPaint(0));
    4
    assertEquals(Color.blue, r.lookupSeriesPaint(0));
    4
    assertEquals(Color.gray, r.lookupSeriesOutlinePaint(0));
    Differences
    Expression1Expression2Difference
    bluegrayVARIABLE_NAME_MISMATCH
    lookupSeriesPaintlookupSeriesOutlinePaintMETHOD_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.lookupSeriesOutlinePaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    assertEquals(Color.gray, r.lookupSeriesOutlinePaint(0));
    5
    assertNull(r.getSeriesPaint(0));
    5
    assertNull(r.getSeriesPaint(0));
    2
    assertEquals(Color.gray, r.getBaseOutlinePaint());
    Differences
    Expression1Expression2Difference
    assertNullassertEqualsMETHOD_INVOCATION_NAME_MISMATCH
    assertNull(r.getSeriesPaint(0))assertEquals(Color.gray,r.getBaseOutlinePaint())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertNull(r.getSeriesPaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(r.getSeriesPaint(0)) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) is a void method call, and thus it cannot be parameterized
    Expression assertNull(r.getSeriesPaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(r.getSeriesPaint(0)) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) is a void method call, and thus it cannot be parameterized
    2
    assertEquals(Color.gray, r.getBaseOutlinePaint());
    6
    r.setAutoPopulateSeriesPaint(true);
    6
    r.setAutoPopulateSeriesPaint(true);
    6
    r.setAutoPopulateSeriesOutlinePaint(true);
    Differences
    Expression1Expression2Difference
    setAutoPopulateSeriesPaintsetAutoPopulateSeriesOutlinePaintMETHOD_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.setAutoPopulateSeriesOutlinePaint(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.setAutoPopulateSeriesOutlinePaint(true) is a void method call, and thus it cannot be parameterized
    6
    r.setAutoPopulateSeriesOutlinePaint(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_OUTLINE_PAINT_SEQUENCE[0], r.lookupSeriesOutlinePaint(0));
    Differences
    Expression1Expression2Difference
    DEFAULT_PAINT_SEQUENCEDEFAULT_OUTLINE_PAINT_SEQUENCEVARIABLE_NAME_MISMATCH
    lookupSeriesPaintlookupSeriesOutlinePaintMETHOD_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.lookupSeriesOutlinePaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    assertEquals(DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE[0], r.lookupSeriesOutlinePaint(0));
    9
    assertNotNull(r.getSeriesPaint(0));
    9
    assertNotNull(r.getSeriesPaint(0));
    9
    assertNotNull(r.getSeriesOutlinePaint(0));
    Differences
    Expression1Expression2Difference
    getSeriesPaintgetSeriesOutlinePaintMETHOD_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.getSeriesOutlinePaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    assertNotNull(r.getSeriesOutlinePaint(0));
    Precondition Violations (30)
    Row Violation
    1Expression assertEquals(Color.blue,r.getBasePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertNull(r.getSeriesOutlinePaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression assertEquals(Color.blue,r.getBasePaint()) is a void method call, and thus it cannot be parameterized
    4Expression assertNull(r.getSeriesOutlinePaint(0)) is a void method call, and thus it cannot be parameterized
    5Expression assertEquals(Color.blue,r.getBasePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression assertNull(r.getSeriesOutlinePaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression assertEquals(Color.blue,r.getBasePaint()) is a void method call, and thus it cannot be parameterized
    8Expression assertNull(r.getSeriesOutlinePaint(0)) is a void method call, and thus it cannot be parameterized
    9Expression r.setAutoPopulateSeriesPaint(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression r.setAutoPopulateSeriesOutlinePaint(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression r.setAutoPopulateSeriesPaint(false) is a void method call, and thus it cannot be parameterized
    12Expression r.setAutoPopulateSeriesOutlinePaint(false) is a void method call, and thus it cannot be parameterized
    13Expression r.lookupSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression r.lookupSeriesOutlinePaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression assertNull(r.getSeriesPaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression assertNull(r.getSeriesPaint(0)) is a void method call, and thus it cannot be parameterized
    18Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) is a void method call, and thus it cannot be parameterized
    19Expression assertNull(r.getSeriesPaint(0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression assertNull(r.getSeriesPaint(0)) is a void method call, and thus it cannot be parameterized
    22Expression assertEquals(Color.gray,r.getBaseOutlinePaint()) is a void method call, and thus it cannot be parameterized
    23Expression r.setAutoPopulateSeriesPaint(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression r.setAutoPopulateSeriesOutlinePaint(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression r.setAutoPopulateSeriesPaint(true) is a void method call, and thus it cannot be parameterized
    26Expression r.setAutoPopulateSeriesOutlinePaint(true) is a void method call, and thus it cannot be parameterized
    27Expression r.lookupSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Expression r.lookupSeriesOutlinePaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Expression r.getSeriesPaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Expression r.getSeriesOutlinePaint(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted