if (annotation == null) { throw new IllegalArgumentException("Null 'annotation' argument."); } boolean removed = this.annotations.remove(annotation); if (removed && notify) { fireChangeEvent(); } return removed;
if (annotation == null) { throw new IllegalArgumentException("Null 'annotation' argument."); } boolean removed = this.annotations.remove(annotation); if (removed && notify) { fireChangeEvent(); } return removed;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: boolean removeAnnotation(CategoryAnnotation, boolean) Method name: boolean removeAnnotation(XYAnnotation, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (annotation == null) {
1
if (annotation == null) {
2
            throw new IllegalArgumentException("Null 'annotation' argument.");
2
            throw new IllegalArgumentException("Null 'annotation' argument.");
3
        }
3
        }
4
        boolean removed = this.annotations.remove(annotation);
4
        boolean removed = this.annotations.remove(annotation);
5
        if (removed && notify) {
5
        if (removed && notify) {
6
            fireChangeEvent();
6
            fireChangeEvent();
7
        }
7
        }
8
        return removed;
8
        return removed;
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  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)18.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (annotation == null)
    1
    if (annotation == null)
    1
    if (annotation == null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryAnnotationorg.jfree.chart.annotations.XYAnnotationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.annotations.CategoryAnnotation of variable annotation does not match with type org.jfree.chart.annotations.XYAnnotation of variable annotation
    • Make classes org.jfree.chart.annotations.CategoryAnnotation and org.jfree.chart.annotations.XYAnnotation extend a common superclass
    1
    if (annotation == null)
    2
    throw new IllegalArgumentException("Null 'annotation' argument.");
    2
    throw new IllegalArgumentException("Null 'annotation' argument.");
    3
    boolean removed = this.annotations.remove(annotation);
    3
    boolean removed = this.annotations.remove(annotation);
    3
    boolean removed = this.annotations.remove(annotation);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryAnnotationorg.jfree.chart.annotations.XYAnnotationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.annotations.CategoryAnnotation of variable annotation does not match with type org.jfree.chart.annotations.XYAnnotation of variable annotation
    • Make classes org.jfree.chart.annotations.CategoryAnnotation and org.jfree.chart.annotations.XYAnnotation extend a common superclass
    3
    boolean removed = this.annotations.remove(annotation);
    4
    if (removed && notify)
    4
    if (removed && notify)
    5
    fireChangeEvent();
    5
    fireChangeEvent();
    6
    return removed;
    6
    return removed;
    Precondition Violations (2)
    Row Violation
    1Type org.jfree.chart.annotations.CategoryAnnotation of variable annotation does not match with type org.jfree.chart.annotations.XYAnnotation of variable annotation
    2Type org.jfree.chart.annotations.CategoryAnnotation of variable annotation does not match with type org.jfree.chart.annotations.XYAnnotation of variable annotation