Font result = this.itemLabelFont; if (result == null) { result = getSeriesItemLabelFont(row); if (result == null) { result = this.baseItemLabelFont; } } return result;
Paint result = this.itemLabelPaint; if (result == null) { result = getSeriesItemLabelPaint(row); if (result == null) { result = this.baseItemLabelPaint; } } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java
Method name: Font getItemLabelFont(int, int) Method name: Paint getItemLabelPaint(int, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
Font result = this.itemLabelFont;
1
Paint result = this.itemLabelPaint;
2
        if (result == null) {
2
        if (result == null) {
3
            result = getSeriesItemLabelFont(row);
3
            result = getSeriesItemLabelPaint(row);
4
            if (result == null) {
4
            if (result == null) {
5
                result = this.baseItemLabelFont;
5
                result = this.baseItemLabelPaint;
6
            }
6
            }
7
        }
7
        }
8
        return result;
8
        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.2
Clones locationClones are declared in the same class
Number of node comparisons12
  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)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                            
    1
    Paint result = this.itemLabelPaint;
    1
    Font result = this.itemLabelFont;
                                                                        
    2
    if (result == null)
    2
    if (result == null)
    2
    if (result == null)
    Differences
    Expression1Expression2Difference
    java.awt.Fontjava.awt.PaintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Font of variable result does not match with type java.awt.Paint of variable result
    • Make classes java.awt.Font and java.awt.Paint extend a common superclass
    2
    if (result == null)
                                                                                  
    3
    result = getSeriesItemLabelPaint(row);
    Preondition Violations
    Unmatched statement result=getSeriesItemLabelPaint(row); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    result = getSeriesItemLabelPaint(row);
    3
    result = getSeriesItemLabelFont(row);
    3
    result = getSeriesItemLabelFont(row);
    Preondition Violations
    Unmatched statement result=getSeriesItemLabelFont(row); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    4
    if (result == null)
    4
    if (result == null)
    4
    if (result == null)
    Differences
    Expression1Expression2Difference
    java.awt.Fontjava.awt.PaintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Font of variable result does not match with type java.awt.Paint of variable result
    • Make classes java.awt.Font and java.awt.Paint extend a common superclass
    4
    if (result == null)
                                                                        
    5
    result = this.baseItemLabelPaint;
    Preondition Violations
    Unmatched statement result=this.baseItemLabelPaint; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result = this.baseItemLabelPaint;
    5
    result = this.baseItemLabelFont;
    5
    result = this.baseItemLabelFont;
    Preondition Violations
    Unmatched statement result=this.baseItemLabelFont; 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 (8)
    Row Violation
    1Type java.awt.Font of variable result does not match with type java.awt.Paint of variable result
    2Unmatched statement result=getSeriesItemLabelPaint(row); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result=getSeriesItemLabelFont(row); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Type java.awt.Font of variable result does not match with type java.awt.Paint of variable result
    5Unmatched statement result=this.baseItemLabelPaint; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement result=this.baseItemLabelFont; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return result;
    8Unmatched return result;