DialPlot p = new DialPlot(); DialCap c1 = new DialCap(); p.setCap(c1); p.addChangeListener(this); this.lastEvent = null; c1.setFillPaint(Color.red); assertNotNull(this.lastEvent); DialCap c2 = new DialCap(); p.setCap(c2); this.lastEvent = null; c1.setFillPaint(Color.blue); assertNull(this.lastEvent); c2.setFillPaint(Color.green); assertNotNull(this.lastEvent);
DialPlot p = new DialPlot(); ArcDialFrame f1 = new ArcDialFrame(); p.setDialFrame(f1); p.addChangeListener(this); this.lastEvent = null; f1.setBackgroundPaint(Color.gray); assertNotNull(this.lastEvent); ArcDialFrame f2 = new ArcDialFrame(); p.setDialFrame(f2); this.lastEvent = null; f1.setBackgroundPaint(Color.blue); assertNull(this.lastEvent); f2.setBackgroundPaint(Color.green); assertNotNull(this.lastEvent);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/dial/junit/DialPlotTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/dial/junit/DialPlotTests.java
Method name: void testCapListener() Method name: void testFrameListener()
Number of AST nodes: 14 Number of AST nodes: 14
1
DialPlot p = new DialPlot();
1
DialPlot p = new DialPlot();
2
        DialCap c1 = new DialCap();
2
        ArcDialFrame f1 = new ArcDialFrame();
3
        p.setCap(c1);
3
        p.setDialFrame(f1);
4
        p.addChangeListener(this);
4
        p.addChangeListener(this);
5
        this.lastEvent = null;
5
        this.lastEvent = null;
6
        c1.setFillPaint(Color.red);
6
        f1.setBackgroundPaint(Color.gray);
7
        assertNotNull(this.lastEvent);
7
        assertNotNull(this.lastEvent);
8
        
8
        
9
        DialCap c2 = new DialCap();
9
        ArcDialFrame f2 = new ArcDialFrame();
10
        p.setCap(c2);
10
        p.setDialFrame(f2);
11
        this.lastEvent = null;
11
        this.lastEvent = null;
12
        c1.setFillPaint(Color.blue);
12
        f1.setBackgroundPaint(Color.blue);
13
        assertNull(this.lastEvent);
13
        assertNull(this.lastEvent);
14
        c2.setFillPaint(Color.green);
14
        f2.setBackgroundPaint(Color.green);
15
        assertNotNull(this.lastEvent);
15
        assertNotNull(this.lastEvent);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons62
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    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
    DialPlot p = new DialPlot();
    1
    DialPlot p = new DialPlot();
    2
    DialCap c1 = new DialCap();
    2
    DialCap c1 = new DialCap();
    2
    ArcDialFrame f1 = new ArcDialFrame();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    c1f1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DialCap() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new ArcDialFrame() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    ArcDialFrame f1 = new ArcDialFrame();
    3
    p.setCap(c1);
    3
    p.setCap(c1);
    3
    p.setDialFrame(f1);
    Differences
    Expression1Expression2Difference
    c1f1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    setCapsetDialFrameMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression p.setCap(c1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.setDialFrame(f1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.setCap(c1) is a void method call, and thus it cannot be parameterized
    Expression p.setDialFrame(f1) is a void method call, and thus it cannot be parameterized
    3
    p.setDialFrame(f1);
    4
    p.addChangeListener(this);
    4
    p.addChangeListener(this);
    5
    this.lastEvent = null;
    5
    this.lastEvent = null;
    6
    c1.setFillPaint(Color.red);
    6
    c1.setFillPaint(Color.red);
    6
    f1.setBackgroundPaint(Color.gray);
    Differences
    Expression1Expression2Difference
    redgrayVARIABLE_NAME_MISMATCH
    setFillPaintsetBackgroundPaintMETHOD_INVOCATION_NAME_MISMATCH
    c1f1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression c1.setFillPaint(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression f1.setBackgroundPaint(Color.gray) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c1.setFillPaint(Color.red) is a void method call, and thus it cannot be parameterized
    Expression f1.setBackgroundPaint(Color.gray) is a void method call, and thus it cannot be parameterized
    Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint)
    6
    f1.setBackgroundPaint(Color.gray);
    7
    assertNotNull(this.lastEvent);
    7
    assertNotNull(this.lastEvent);
    8
    DialCap c2 = new DialCap();
    8
    DialCap c2 = new DialCap();
    8
    ArcDialFrame f2 = new ArcDialFrame();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    c2f2VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DialCap() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new ArcDialFrame() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    ArcDialFrame f2 = new ArcDialFrame();
    9
    p.setCap(c2);
    9
    p.setCap(c2);
    9
    p.setDialFrame(f2);
    Differences
    Expression1Expression2Difference
    c2f2VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    setCapsetDialFrameMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression p.setCap(c2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.setDialFrame(f2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.setCap(c2) is a void method call, and thus it cannot be parameterized
    Expression p.setDialFrame(f2) is a void method call, and thus it cannot be parameterized
    9
    p.setDialFrame(f2);
    10
    this.lastEvent = null;
    10
    this.lastEvent = null;
    11
    c1.setFillPaint(Color.blue);
    11
    c1.setFillPaint(Color.blue);
    11
    f1.setBackgroundPaint(Color.blue);
    Differences
    Expression1Expression2Difference
    setFillPaintsetBackgroundPaintMETHOD_INVOCATION_NAME_MISMATCH
    c1f1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression c1.setFillPaint(Color.blue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression f1.setBackgroundPaint(Color.blue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c1.setFillPaint(Color.blue) is a void method call, and thus it cannot be parameterized
    Expression f1.setBackgroundPaint(Color.blue) is a void method call, and thus it cannot be parameterized
    Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint)
    11
    f1.setBackgroundPaint(Color.blue);
    12
    assertNull(this.lastEvent);
    12
    assertNull(this.lastEvent);
    13
    c2.setFillPaint(Color.green);
    13
    c2.setFillPaint(Color.green);
    13
    f2.setBackgroundPaint(Color.green);
    Differences
    Expression1Expression2Difference
    setFillPaintsetBackgroundPaintMETHOD_INVOCATION_NAME_MISMATCH
    c2f2VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression c2.setFillPaint(Color.green) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression f2.setBackgroundPaint(Color.green) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c2.setFillPaint(Color.green) is a void method call, and thus it cannot be parameterized
    Expression f2.setBackgroundPaint(Color.green) is a void method call, and thus it cannot be parameterized
    Expression c2 cannot be unified with expression f2 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint)
    13
    f2.setBackgroundPaint(Color.green);
    14
    assertNotNull(this.lastEvent);
    14
    assertNotNull(this.lastEvent);
    Precondition Violations (27)
    Row Violation
    1Expression new DialCap() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new ArcDialFrame() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression p.setCap(c1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression p.setDialFrame(f1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression p.setCap(c1) is a void method call, and thus it cannot be parameterized
    6Expression p.setDialFrame(f1) is a void method call, and thus it cannot be parameterized
    7Expression c1.setFillPaint(Color.red) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression f1.setBackgroundPaint(Color.gray) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression c1.setFillPaint(Color.red) is a void method call, and thus it cannot be parameterized
    10Expression f1.setBackgroundPaint(Color.gray) is a void method call, and thus it cannot be parameterized
    11Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint)
    12Expression new DialCap() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression new ArcDialFrame() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression p.setCap(c2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression p.setDialFrame(f2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression p.setCap(c2) is a void method call, and thus it cannot be parameterized
    17Expression p.setDialFrame(f2) is a void method call, and thus it cannot be parameterized
    18Expression c1.setFillPaint(Color.blue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression f1.setBackgroundPaint(Color.blue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression c1.setFillPaint(Color.blue) is a void method call, and thus it cannot be parameterized
    21Expression f1.setBackgroundPaint(Color.blue) is a void method call, and thus it cannot be parameterized
    22Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint)
    23Expression c2.setFillPaint(Color.green) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression f2.setBackgroundPaint(Color.green) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression c2.setFillPaint(Color.green) is a void method call, and thus it cannot be parameterized
    26Expression f2.setBackgroundPaint(Color.green) is a void method call, and thus it cannot be parameterized
    27Expression c2 cannot be unified with expression f2 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint)