if (insets == null) { throw new IllegalArgumentException("Null 'insets' argument."); } if (!this.tickLabelInsets.equals(insets)) { this.tickLabelInsets = insets; notifyListeners(new AxisChangeEvent(this)); }
if (font == null) { throw new IllegalArgumentException("Null 'font' argument."); } if (!this.font.equals(font)) { this.font = font; notifyListeners(new TitleChangeEvent(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/title/TextTitle.java
Method name: void setTickLabelInsets(RectangleInsets) Method name: void setFont(Font)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (insets == null) {
1
if (font == null) {
2
            throw new IllegalArgumentException("Null 'insets' argument.");
2
            throw new IllegalArgumentException("Null 'font' argument.");
3
        }
3
        }
4
        if (!this.tickLabelInsets.equals(insets)) {
4
        if (!this.font.equals(font)) {
5
            this.tickLabelInsets = insets;
5
            this.font = font;
6
            notifyListeners(new AxisChangeEvent(this));
6
            notifyListeners(new TitleChangeEvent(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.4
Clones locationClones are in different classes
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)9.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (insets == null)
    1
    if (insets == null)
    1
    if (font == null)
    Differences
    Expression1Expression2Difference
    insetsfontVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleInsetsjava.awt.FontVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleInsets of variable insets does not match with type java.awt.Font of variable font
    • Make classes org.jfree.ui.RectangleInsets and java.awt.Font extend a common superclass
    1
    if (font == null)
    2
    throw new IllegalArgumentException("Null 'insets' argument.");
    2
    throw new IllegalArgumentException("Null 'insets' argument.");
    2
    throw new IllegalArgumentException("Null 'font' argument.");
    Differences
    Expression1Expression2Difference
    "Null 'insets' argument.""Null 'font' argument."LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("Null 'font' argument.");
    3
    if (!this.tickLabelInsets.equals(insets))
    3
    if (!this.tickLabelInsets.equals(insets))
    3
    if (!this.font.equals(font))
    Differences
    Expression1Expression2Difference
    insetsfontVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleInsetsjava.awt.FontVARIABLE_TYPE_MISMATCH
    tickLabelInsetsfontVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleInsetsjava.awt.FontVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleInsets of variable insets does not match with type java.awt.Font of variable font
    • Make classes org.jfree.ui.RectangleInsets and java.awt.Font extend a common superclass
    Type org.jfree.ui.RectangleInsets of variable this.tickLabelInsets does not match with type java.awt.Font of variable this.font
    • Make classes org.jfree.ui.RectangleInsets and java.awt.Font extend a common superclass
    3
    if (!this.font.equals(font))
                                        
    4
    this.font = font;
    Preondition Violations
    Unmatched statement this.font=font; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    this.font = font;
    4
    this.tickLabelInsets = 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
                                                                  
    5
    notifyListeners(new AxisChangeEvent(this));
    5
    notifyListeners(new AxisChangeEvent(this));
    5
    notifyListeners(new TitleChangeEvent(this));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.event.AxisChangeEventorg.jfree.chart.event.TitleChangeEventSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new AxisChangeEvent(this) cannot be unified with expression new TitleChangeEvent(this) , because common superclass type org.jfree.chart.event.ChartChangeEvent cannot be passed as an argument to protected void notifyListeners(org.jfree.chart.event.AxisChangeEvent)
    5
    notifyListeners(new TitleChangeEvent(this));
    Precondition Violations (7)
    Row Violation
    1Type org.jfree.ui.RectangleInsets of variable insets does not match with type java.awt.Font of variable font
    2Type org.jfree.ui.RectangleInsets of variable insets does not match with type java.awt.Font of variable font
    3Type org.jfree.ui.RectangleInsets of variable this.tickLabelInsets does not match with type java.awt.Font of variable this.font
    4Unmatched statement this.font=font; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement this.tickLabelInsets=insets; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Expression new AxisChangeEvent(this) cannot be unified with expression new TitleChangeEvent(this) , because common superclass type org.jfree.chart.event.ChartChangeEvent cannot be passed as an argument to protected void notifyListeners(org.jfree.chart.event.AxisChangeEvent)
    7The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.Axis and org.jfree.chart.title.TextTitle do not have a common superclass