if (font == null) { throw new IllegalArgumentException("Null 'font' argument."); } if (!this.labelFont.equals(font)) { this.labelFont = font; notifyListeners(new AxisChangeEvent(this)); }
if (insets == null) { throw new IllegalArgumentException("Null 'insets' argument."); } if (!this.tickLabelInsets.equals(insets)) { this.tickLabelInsets = insets; 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 setTickLabelInsets(RectangleInsets)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (font == null) {
1
if (insets == null) {
2
            throw new IllegalArgumentException("Null 'font' argument.");
2
            throw new IllegalArgumentException("Null 'insets' argument.");
3
        }
3
        }
4
        if (!this.labelFont.equals(font)) {
4
        if (!this.tickLabelInsets.equals(insets)) {
5
            this.labelFont = font;
5
            this.tickLabelInsets = insets;
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 statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (font == null)
    1
    if (font == null)
    1
    if (insets == null)
    Differences
    Expression1Expression2Difference
    fontinsetsVARIABLE_NAME_MISMATCH
    java.awt.Fontorg.jfree.ui.RectangleInsetsVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Font of variable font does not match with type org.jfree.ui.RectangleInsets of variable insets
    • Make classes java.awt.Font and org.jfree.ui.RectangleInsets extend a common superclass
    1
    if (insets == null)
    2
    throw new IllegalArgumentException("Null 'font' argument.");
    2
    throw new IllegalArgumentException("Null 'font' argument.");
    2
    throw new IllegalArgumentException("Null 'insets' argument.");
    Differences
    Expression1Expression2Difference
    "Null 'font' argument.""Null 'insets' argument."LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("Null 'insets' argument.");
    3
    if (!this.labelFont.equals(font))
    3
    if (!this.labelFont.equals(font))
    3
    if (!this.tickLabelInsets.equals(insets))
    Differences
    Expression1Expression2Difference
    fontinsetsVARIABLE_NAME_MISMATCH
    java.awt.Fontorg.jfree.ui.RectangleInsetsVARIABLE_TYPE_MISMATCH
    labelFonttickLabelInsetsVARIABLE_NAME_MISMATCH
    java.awt.Fontorg.jfree.ui.RectangleInsetsVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Font of variable font does not match with type org.jfree.ui.RectangleInsets of variable insets
    • Make classes java.awt.Font and org.jfree.ui.RectangleInsets extend a common superclass
    Type java.awt.Font of variable this.labelFont does not match with type org.jfree.ui.RectangleInsets of variable this.tickLabelInsets
    • Make classes java.awt.Font and org.jfree.ui.RectangleInsets extend a common superclass
    3
    if (!this.tickLabelInsets.equals(insets))
                                                                  
    4
    this.tickLabelInsets = insets;
    Preondition Violations
    Unmatched statement this.tickLabelInsets=insets; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    this.tickLabelInsets = insets;
    4
    this.labelFont = font;
    4
    this.labelFont = font;
    Preondition Violations
    Unmatched statement this.labelFont=font; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                  
    5
    notifyListeners(new AxisChangeEvent(this));
    5
    notifyListeners(new AxisChangeEvent(this));
    Precondition Violations (5)
    Row Violation
    1Type java.awt.Font of variable font does not match with type org.jfree.ui.RectangleInsets of variable insets
    2Type java.awt.Font of variable font does not match with type org.jfree.ui.RectangleInsets of variable insets
    3Type java.awt.Font of variable this.labelFont does not match with type org.jfree.ui.RectangleInsets of variable this.tickLabelInsets
    4Unmatched statement this.tickLabelInsets=insets; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement this.labelFont=font; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted