if (category == null) { throw new IllegalArgumentException("Null 'category' argument."); } if (font == null) { this.tickLabelFontMap.remove(category); } else { this.tickLabelFontMap.put(category, font); } notifyListeners(new AxisChangeEvent(this));
if (category == null) { throw new IllegalArgumentException("Null 'category' argument."); } if (paint == null) { this.tickLabelPaintMap.remove(category); } else { this.tickLabelPaintMap.put(category, paint); } notifyListeners(new AxisChangeEvent(this));
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: void setTickLabelFont(Comparable, Font) Method name: void setTickLabelPaint(Comparable, Paint)
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
        if (font == null) {
4
        if (paint == null) {
5
            this.tickLabelFontMap.remove(category);
5
            this.tickLabelPaintMap.remove(category);
6
        }
6
        }
7
        else {
7
        else {
8
            this.tickLabelFontMap.put(category, font);
8
            this.tickLabelPaintMap.put(category, paint);
9
        }
9
        }
10
        notifyListeners(new AxisChangeEvent(this));
10
        notifyListeners(new AxisChangeEvent(this));
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 comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)15.8
    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
    if (font == null)
    3
    if (font == null)
    3
    if (paint == null)
    Differences
    Expression1Expression2Difference
    fontpaintVARIABLE_NAME_MISMATCH
    java.awt.Fontjava.awt.PaintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Font of variable font does not match with type java.awt.Paint of variable paint
    • Make classes java.awt.Font and java.awt.Paint extend a common superclass
    3
    if (paint == null)
    4
    this.tickLabelFontMap.remove(category);
    4
    this.tickLabelFontMap.remove(category);
    4
    this.tickLabelPaintMap.remove(category);
    Differences
    Expression1Expression2Difference
    tickLabelFontMaptickLabelPaintMapVARIABLE_NAME_MISMATCH
    4
    this.tickLabelPaintMap.remove(category);
    else
    else
    5
    this.tickLabelFontMap.put(category, font);
    5
    this.tickLabelFontMap.put(category, font);
    5
    this.tickLabelPaintMap.put(category, paint);
    Differences
    Expression1Expression2Difference
    fontpaintVARIABLE_NAME_MISMATCH
    java.awt.Fontjava.awt.PaintVARIABLE_TYPE_MISMATCH
    tickLabelFontMaptickLabelPaintMapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.awt.Font of variable font does not match with type java.awt.Paint of variable paint
    • Make classes java.awt.Font and java.awt.Paint extend a common superclass
    Expression this.tickLabelFontMap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.tickLabelPaintMap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    this.tickLabelPaintMap.put(category, paint);
    6
    notifyListeners(new AxisChangeEvent(this));
    6
    notifyListeners(new AxisChangeEvent(this));
    Precondition Violations (4)
    Row Violation
    1Type java.awt.Font of variable font does not match with type java.awt.Paint of variable paint
    2Type java.awt.Font of variable font does not match with type java.awt.Paint of variable paint
    3Expression this.tickLabelFontMap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.tickLabelPaintMap cannot be parameterized, because it has dependencies to/from statements that will be extracted