if (this.renderer != null) { this.renderer.removeChangeListener(this); } this.renderer = renderer; if (renderer != null) { renderer.setPlot(this); } fireChangeEvent();
if (this.cap != null) { this.cap.removeChangeListener(this); } this.cap = cap; if (cap != null) { cap.addChangeListener(this); } fireChangeEvent();
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/WaferMapPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialPlot.java
Method name: void setRenderer(WaferMapRenderer) Method name: void setCap(DialLayer)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (this.renderer != null) {
1
if (this.cap != null) {
2
            this.renderer.removeChangeListener(this);
2
            this.cap.removeChangeListener(this);
3
        }
3
        }
4
        this.renderer = renderer;
4
        this.cap = cap;
5
        if (renderer != null) {
5
        if (cap != null) {
6
            renderer.setPlot(this);
6
            cap.addChangeListener(this);
7
        }
7
        }
8
        fireChangeEvent();
8
        fireChangeEvent();
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)18.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.renderer != null)
    1
    if (this.renderer != null)
    1
    if (this.cap != null)
    Differences
    Expression1Expression2Difference
    renderercapVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.WaferMapRendererorg.jfree.chart.plot.dial.DialLayerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.WaferMapRenderer of variable this.renderer does not match with type org.jfree.chart.plot.dial.DialLayer of variable this.cap
    • Make classes org.jfree.chart.renderer.WaferMapRenderer and org.jfree.chart.plot.dial.DialLayer extend a common superclass
    1
    if (this.cap != null)
    2
    this.renderer.removeChangeListener(this);
    2
    this.renderer.removeChangeListener(this);
    2
    this.cap.removeChangeListener(this);
    Differences
    Expression1Expression2Difference
    renderercapVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.WaferMapRendererorg.jfree.chart.plot.dial.DialLayerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.WaferMapRenderer of variable this.renderer does not match with type org.jfree.chart.plot.dial.DialLayer of variable this.cap
    • Make classes org.jfree.chart.renderer.WaferMapRenderer and org.jfree.chart.plot.dial.DialLayer extend a common superclass
    2
    this.cap.removeChangeListener(this);
                                    
    3
    this.cap = cap;
    Preondition Violations
    Unmatched statement this.cap=cap; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    this.cap = cap;
    3
    this.renderer = renderer;
    3
    this.renderer = renderer;
    Preondition Violations
    Unmatched statement this.renderer=renderer; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                        
    4
    if (renderer != null)
    4
    if (renderer != null)
    4
    if (cap != null)
    Differences
    Expression1Expression2Difference
    renderercapVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.WaferMapRendererorg.jfree.chart.plot.dial.DialLayerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.WaferMapRenderer of variable renderer does not match with type org.jfree.chart.plot.dial.DialLayer of variable cap
    • Make classes org.jfree.chart.renderer.WaferMapRenderer and org.jfree.chart.plot.dial.DialLayer extend a common superclass
    4
    if (cap != null)
                                                                  
    5
    cap.addChangeListener(this);
    Preondition Violations
    Unmatched statement cap.addChangeListener(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    cap.addChangeListener(this);
    5
    renderer.setPlot(this);
    5
    renderer.setPlot(this);
    Preondition Violations
    Unmatched statement renderer.setPlot(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                        
    6
    fireChangeEvent();
    6
    fireChangeEvent();
    Precondition Violations (7)
    Row Violation
    1Type org.jfree.chart.renderer.WaferMapRenderer of variable this.renderer does not match with type org.jfree.chart.plot.dial.DialLayer of variable this.cap
    2Type org.jfree.chart.renderer.WaferMapRenderer of variable this.renderer does not match with type org.jfree.chart.plot.dial.DialLayer of variable this.cap
    3Unmatched statement this.cap=cap; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement this.renderer=renderer; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Type org.jfree.chart.renderer.WaferMapRenderer of variable renderer does not match with type org.jfree.chart.plot.dial.DialLayer of variable cap
    6Unmatched statement cap.addChangeListener(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement renderer.setPlot(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted