if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (bottom == null) { throw new IllegalArgumentException("Null 'bottom' argument."); } return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), bottom, base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT) );
if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (left == null) { throw new IllegalArgumentException("Null 'left' argument."); } return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), base.getLabelPosition(RectangleEdge.BOTTOM), left, base.getLabelPosition(RectangleEdge.RIGHT) );
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 replaceBottomPosition(CategoryLabelPositions, CategoryLabelPosition) Method name: CategoryLabelPositions replaceLeftPosition(CategoryLabelPositions, CategoryLabelPosition)
Number of AST nodes: 5 Number of AST nodes: 5
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 (bottom == null) {
4
        if (left == null) {
5
            throw new IllegalArgumentException("Null 'bottom' argument.");
5
            throw new IllegalArgumentException("Null 'left' argument.");
6
        }
6
        }
7
        
7
        
8
        return new CategoryLabelPositions(
8
        return new CategoryLabelPositions(
9
            base.getLabelPosition(RectangleEdge.TOP),
9
            base.getLabelPosition(RectangleEdge.TOP),
10
            bottom,
11
            base.getLabelPosition(RectangleEdge.LEFT)
10
            base.getLabelPosition(RectangleEdge.BOTTOM),
12
,
11
            left,
13
            base.getLabelPosition(RectangleEdge.RIGHT)
12
            base.getLabelPosition(RectangleEdge.RIGHT)
14
        );
13
        );
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {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.5
    Clone typeType 2
    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 (bottom == null)
    3
    if (bottom == null)
    3
    if (left == null)
    Differences
    Expression1Expression2Difference
    bottomleftVARIABLE_NAME_MISMATCH
    3
    if (left == null)
    4
    throw new IllegalArgumentException("Null 'bottom' argument.");
    4
    throw new IllegalArgumentException("Null 'bottom' argument.");
    4
    throw new IllegalArgumentException("Null 'left' argument.");
    Differences
    Expression1Expression2Difference
    "Null 'bottom' argument.""Null 'left' argument."LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("Null 'left' argument.");
    5
    return new CategoryLabelPositions(base.getLabelPosition(RectangleEdge.TOP), bottom, base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT));
    5
    return new CategoryLabelPositions(base.getLabelPosition(RectangleEdge.TOP), bottom, base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT));
    5
    return new CategoryLabelPositions(base.getLabelPosition(RectangleEdge.TOP), base.getLabelPosition(RectangleEdge.BOTTOM), left, base.getLabelPosition(RectangleEdge.RIGHT));
    Differences
    Expression1Expression2Difference
    bottombase.getLabelPosition(RectangleEdge.BOTTOM)TYPE_COMPATIBLE_REPLACEMENT
    base.getLabelPosition(RectangleEdge.LEFT)leftTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression base.getLabelPosition(RectangleEdge.BOTTOM) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression base.getLabelPosition(RectangleEdge.LEFT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    return new CategoryLabelPositions(base.getLabelPosition(RectangleEdge.TOP), base.getLabelPosition(RectangleEdge.BOTTOM), left, base.getLabelPosition(RectangleEdge.RIGHT));
    Precondition Violations (2)
    Row Violation
    1Expression base.getLabelPosition(RectangleEdge.BOTTOM) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression base.getLabelPosition(RectangleEdge.LEFT) cannot be parameterized, because it has dependencies to/from statements that will be extracted