if (font == null) { throw new IllegalArgumentException("Null 'font' argument."); } if (!this.labelFont.equals(font)) { this.labelFont = font; notifyListeners(new AxisChangeEvent(this)); }
if (font == null) { throw new IllegalArgumentException("Null 'font' argument."); } if (!this.tickLabelFont.equals(font)) { this.tickLabelFont = font; notifyListeners(new AxisChangeEvent(this)); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/Axis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/Axis.java
Method name: void setLabelFont(Font) Method name: void setTickLabelFont(Font)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (font == null) {
1
if (font == null) {
2
            throw new IllegalArgumentException("Null 'font' argument.");
2
            throw new IllegalArgumentException("Null 'font' argument.");
3
        }
3
        }
4
        if (!this.labelFont.equals(font)) {
4
        if (!this.tickLabelFont.equals(font)) {
5
            this.labelFont = font;
5
            this.tickLabelFont = font;
6
            notifyListeners(new AxisChangeEvent(this));
6
            notifyListeners(new AxisChangeEvent(this));
7
        }
7
        }
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 comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (font == null)
    1
    if (font == null)
    2
    throw new IllegalArgumentException("Null 'font' argument.");
    2
    throw new IllegalArgumentException("Null 'font' argument.");
    3
    if (!this.labelFont.equals(font))
    3
    if (!this.labelFont.equals(font))
    3
    if (!this.tickLabelFont.equals(font))
    Differences
    Expression1Expression2Difference
    labelFonttickLabelFontVARIABLE_NAME_MISMATCH
    3
    if (!this.tickLabelFont.equals(font))
    4
    this.labelFont = font;
    4
    this.labelFont = font;
    4
    this.tickLabelFont = font;
    Differences
    Expression1Expression2Difference
    labelFonttickLabelFontVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.labelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.labelFont is a field being modified, and thus it cannot be parameterized
    Expression this.tickLabelFont is a field being modified, and thus it cannot be parameterized
    4
    this.tickLabelFont = font;
    5
    notifyListeners(new AxisChangeEvent(this));
    5
    notifyListeners(new AxisChangeEvent(this));
    Precondition Violations (4)
    Row Violation
    1Expression this.labelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression this.labelFont is a field being modified, and thus it cannot be parameterized
    4Expression this.tickLabelFont is a field being modified, and thus it cannot be parameterized