if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (top == null) { throw new IllegalArgumentException("Null 'top' argument."); } return new CategoryLabelPositions( top, base.getLabelPosition(RectangleEdge.BOTTOM), base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT) );
if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (right == null) { throw new IllegalArgumentException("Null 'right' argument."); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPositions.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPositions.java
Method name: CategoryLabelPositions replaceTopPosition(CategoryLabelPositions, CategoryLabelPosition) Method name: CategoryLabelPositions replaceRightPosition(CategoryLabelPositions, CategoryLabelPosition)
Number of AST nodes: 5 Number of AST nodes: 4
1
if (base == null) {
1
if (base == null) {
2
            throw new IllegalArgumentException("Null 'base' argument.");
2
            throw new IllegalArgumentException("Null 'base' argument.");
3
        }
3
        }
4
        if (top == null) {
4
        if (right == null) {
5
            throw new IllegalArgumentException("Null 'top' argument.");
5
            throw new IllegalArgumentException("Null 'right' argument.");
6
        }
6
        }
7
        
8
        return new CategoryLabelPositions(
9
            top, 
10
            base.getLabelPosition(RectangleEdge.BOTTOM),
11
            base.getLabelPosition(RectangleEdge.LEFT),
12
            base.getLabelPosition(RectangleEdge.RIGHT)
13
        );
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.2
Clones locationClones are declared in the same class
Number of node comparisons13
  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 fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (base == null)
    1
    if (base == null)
    2
    throw new IllegalArgumentException("Null 'base' argument.");
    2
    throw new IllegalArgumentException("Null 'base' argument.");
    3
    if (top == null)
    3
    if (top == null)
    3
    if (right == null)
    Differences
    Expression1Expression2Difference
    toprightVARIABLE_NAME_MISMATCH
    3
    if (right == null)
    4
    throw new IllegalArgumentException("Null 'top' argument.");
    4
    throw new IllegalArgumentException("Null 'top' argument.");
    4
    throw new IllegalArgumentException("Null 'right' argument.");
    Differences
    Expression1Expression2Difference
    "Null 'top' argument.""Null 'right' argument."LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("Null 'right' argument.");
    5
    return new CategoryLabelPositions(top, base.getLabelPosition(RectangleEdge.BOTTOM), base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT));
    5
    return new CategoryLabelPositions(top, base.getLabelPosition(RectangleEdge.BOTTOM), base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT));
    Preondition Violations
    Unmatched statement return new CategoryLabelPositions(top,base.getLabelPosition(RectangleEdge.BOTTOM),base.getLabelPosition(RectangleEdge.LEFT),base.getLabelPosition(RectangleEdge.RIGHT)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return new CategoryLabelPositions(top,base.getLabelPosition(RectangleEdge.BOTTOM),base.getLabelPosition(RectangleEdge.LEFT),base.getLabelPosition(RectangleEdge.RIGHT));
                                                                                                                                                                                                                                                                                                                                                          
    Precondition Violations (2)
    Row Violation
    1Unmatched statement return new CategoryLabelPositions(top,base.getLabelPosition(RectangleEdge.BOTTOM),base.getLabelPosition(RectangleEdge.LEFT),base.getLabelPosition(RectangleEdge.RIGHT)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return new CategoryLabelPositions(top,base.getLabelPosition(RectangleEdge.BOTTOM),base.getLabelPosition(RectangleEdge.LEFT),base.getLabelPosition(RectangleEdge.RIGHT));