if (category == null) { throw new IllegalArgumentException("Null 'category' argument."); } Font result = (Font) this.tickLabelFontMap.get(category); // if there is no specific font, use the general one... if (result == null) { result = getTickLabelFont(); } return result;
if (category == null) { throw new IllegalArgumentException("Null 'category' argument."); } Paint result = (Paint) this.tickLabelPaintMap.get(category); // if there is no specific paint, use the general one... if (result == null) { result = getTickLabelPaint(); } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAxis.java
Method name: Font getTickLabelFont(Comparable) Method name: Paint getTickLabelPaint(Comparable)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (category == null) {
1
if (category == null) {
2
            throw new IllegalArgumentException("Null 'category' argument.");
2
            throw new IllegalArgumentException("Null 'category' argument.");
3
        }
3
        }
4
        Font result = (Font) this.tickLabelFontMap.get(category);
4
        Paint result = (Paint) this.tickLabelPaintMap.get(category);
5
        // if there is no specific font, use the general one...
5
        // if there is no specific paint, use the general one...
6
        if (result == null) {
6
        if (result == null) {
7
            result = getTickLabelFont();
7
            result = getTickLabelPaint();
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.3
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (category == null)
    1
    if (category == null)
    2
    throw new IllegalArgumentException("Null 'category' argument.");
    2
    throw new IllegalArgumentException("Null 'category' argument.");
                                                                                                                            
    3
    Paint result = (Paint)this.tickLabelPaintMap.get(category);
    Preondition Violations
    Unmatched statement Paint result=(Paint)this.tickLabelPaintMap.get(category); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    Paint result = (Paint)this.tickLabelPaintMap.get(category);
    3
    Font result = (Font)this.tickLabelFontMap.get(category);
    3
    Font result = (Font)this.tickLabelFontMap.get(category);
    Preondition Violations
    Unmatched statement Font result=(Font)this.tickLabelFontMap.get(category); cannot be moved before the extracted code, because it has control dependencies 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 = getTickLabelPaint();
    Preondition Violations
    Unmatched statement result=getTickLabelPaint(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result = getTickLabelPaint();
    5
    result = getTickLabelFont();
    5
    result = getTickLabelFont();
    Preondition Violations
    Unmatched statement result=getTickLabelFont(); 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 (7)
    Row Violation
    1Unmatched statement Paint result=(Paint)this.tickLabelPaintMap.get(category); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement Font result=(Font)this.tickLabelFontMap.get(category); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Type java.awt.Font of variable result does not match with type java.awt.Paint of variable result
    4Unmatched statement result=getTickLabelPaint(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement result=getTickLabelFont(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return result;
    7Unmatched return result;