if (this.seriesOutlinePaint != null) { return this.seriesOutlinePaint; } // otherwise look up the paint list Paint result = this.seriesOutlinePaintList.getPaint(series); if (result == null) { result = this.baseSeriesOutlinePaint; } return result;
if (this.seriesOutlineStroke != null) { return this.seriesOutlineStroke; } // otherwise look up the paint list Stroke result = this.seriesOutlineStrokeList.getStroke(series); if (result == null) { result = this.baseSeriesOutlineStroke; } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/SpiderWebPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/SpiderWebPlot.java
Method name: Paint getSeriesOutlinePaint(int) Method name: Stroke getSeriesOutlineStroke(int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (this.seriesOutlinePaint != null) {
1
if (this.seriesOutlineStroke != null) {
2
            return this.seriesOutlinePaint;
2
            return this.seriesOutlineStroke;
3
        }
3
        }
4
        // otherwise look up the paint list
4
        // otherwise look up the paint list
5
        Paint result = this.seriesOutlinePaintList.getPaint(series);
5
        Stroke result = this.seriesOutlineStrokeList.getStroke(series);
6
        if (result == null) {
6
        if (result == null) {
7
            result = this.baseSeriesOutlinePaint;
7
            result = this.baseSeriesOutlineStroke;
8
        }
8
        }
9
        return result;
9
        return result;
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.4
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)17.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.seriesOutlinePaint != null)
    1
    if (this.seriesOutlinePaint != null)
    1
    if (this.seriesOutlineStroke != null)
    Differences
    Expression1Expression2Difference
    seriesOutlinePaintseriesOutlineStrokeVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.seriesOutlinePaint does not match with type java.awt.Stroke of variable this.seriesOutlineStroke
    • Make classes java.awt.Paint and java.awt.Stroke extend a common superclass
    1
    if (this.seriesOutlineStroke != null)
                                                                          
    2
    return this.seriesOutlineStroke;
    Preondition Violations
    Unmatched statement return this.seriesOutlineStroke; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return this.seriesOutlineStroke;
    2
    return this.seriesOutlineStroke;
    2
    return this.seriesOutlinePaint;
    2
    return this.seriesOutlinePaint;
    Preondition Violations
    Unmatched statement return this.seriesOutlinePaint; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return this.seriesOutlinePaint;
                                                                        
                                                                                                                                    
    3
    Stroke result = this.seriesOutlineStrokeList.getStroke(series);
    3
    Paint result = this.seriesOutlinePaintList.getPaint(series);
                                                                                                                              
    4
    if (result == null)
    4
    if (result == null)
    4
    if (result == null)
    Differences
    Expression1Expression2Difference
    java.awt.Paintjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable result does not match with type java.awt.Stroke of variable result
    • Make classes java.awt.Paint and java.awt.Stroke extend a common superclass
    4
    if (result == null)
                                                                                  
    5
    result = this.baseSeriesOutlineStroke;
    Preondition Violations
    Unmatched statement result=this.baseSeriesOutlineStroke; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result = this.baseSeriesOutlineStroke;
    5
    result = this.baseSeriesOutlinePaint;
    5
    result = this.baseSeriesOutlinePaint;
    Preondition Violations
    Unmatched statement result=this.baseSeriesOutlinePaint; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
                                      
    6
    return result;
    Preondition Violations
    Unmatched return result;
    6
    return result;
    6
    return result;
    6
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (11)
    Row Violation
    1Type java.awt.Paint of variable this.seriesOutlinePaint does not match with type java.awt.Stroke of variable this.seriesOutlineStroke
    2Unmatched statement return this.seriesOutlineStroke; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return this.seriesOutlineStroke;
    4Unmatched statement return this.seriesOutlinePaint; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return this.seriesOutlinePaint;
    6Type java.awt.Paint of variable result does not match with type java.awt.Stroke of variable result
    7Unmatched statement result=this.baseSeriesOutlineStroke; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement result=this.baseSeriesOutlinePaint; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched return result;
    10Unmatched return result;
    11The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero