if (isVerticalTickLabels()) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; if (edge == RectangleEdge.LEFT) { angle = -Math.PI / 2.0; } else { angle = Math.PI / 2.0; } } else { if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.CENTER_RIGHT; rotationAnchor = TextAnchor.CENTER_RIGHT; } else { anchor = TextAnchor.CENTER_LEFT; rotationAnchor = TextAnchor.CENTER_LEFT; } }
if (isVerticalTickLabels()) { anchor = TextAnchor.CENTER_RIGHT; rotationAnchor = TextAnchor.CENTER_RIGHT; if (edge == RectangleEdge.TOP) { angle = Math.PI / 2.0; } else { angle = -Math.PI / 2.0; } } else { if (edge == RectangleEdge.TOP) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; } else { anchor = TextAnchor.TOP_CENTER; rotationAnchor = TextAnchor.TOP_CENTER; } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SymbolAxis.java
Method name: List refreshTicksVertical(Graphics2D, Rectangle2D, RectangleEdge) Method name: List refreshTicksHorizontal(Graphics2D, Rectangle2D, RectangleEdge)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (isVerticalTickLabels()) {
1
if (isVerticalTickLabels()) {
2
                    anchor = TextAnchor.BOTTOM_CENTER;
2
                    anchor = TextAnchor.CENTER_RIGHT;
3
                    rotationAnchor = TextAnchor.BOTTOM_CENTER;
3
                    rotationAnchor = TextAnchor.CENTER_RIGHT;
4
                    if (edge == RectangleEdge.LEFT) {
4
                    if (edge == RectangleEdge.TOP) {
5
                        angle = -Math.PI / 2.0;
5
                        angle = Math.PI / 2.0;
6
                    }
6
                    }
7
                    else {
7
                    else {
8
                        angle = Math.PI / 2.0;
8
                        angle = -Math.PI / 2.0;
9
                    }
9
                    }
10
                }
10
                }
11
                else {
11
                else {
12
                    if (edge == RectangleEdge.LEFT) {
12
                    if (edge == RectangleEdge.TOP) {
13
                        anchor = TextAnchor.CENTER_RIGHT;
13
                        anchor = TextAnchor.BOTTOM_CENTER;
14
                        rotationAnchor = TextAnchor.CENTER_RIGHT;
14
                        rotationAnchor = TextAnchor.BOTTOM_CENTER;
15
                    }
15
                    }
16
                    else {
16
                    else {
17
                        anchor = TextAnchor.CENTER_LEFT;
17
                        anchor = TextAnchor.TOP_CENTER;
18
                        rotationAnchor = TextAnchor.CENTER_LEFT;
18
                        rotationAnchor = TextAnchor.TOP_CENTER;
19
                    }
19
                    }
20
                }
20
                }
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons61
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    19
    if (isVerticalTickLabels())
    32
    if (isVerticalTickLabels())
    20
    anchor = TextAnchor.BOTTOM_CENTER;
    20
    anchor = TextAnchor.BOTTOM_CENTER;
    33
    anchor = TextAnchor.CENTER_RIGHT;
    Differences
    Expression1Expression2Difference
    BOTTOM_CENTERCENTER_RIGHTVARIABLE_NAME_MISMATCH
    33
    anchor = TextAnchor.CENTER_RIGHT;
    21
    rotationAnchor = TextAnchor.BOTTOM_CENTER;
    21
    rotationAnchor = TextAnchor.BOTTOM_CENTER;
    34
    rotationAnchor = TextAnchor.CENTER_RIGHT;
    Differences
    Expression1Expression2Difference
    BOTTOM_CENTERCENTER_RIGHTVARIABLE_NAME_MISMATCH
    34
    rotationAnchor = TextAnchor.CENTER_RIGHT;
    22
    if (edge == RectangleEdge.LEFT)
    22
    if (edge == RectangleEdge.LEFT)
    35
    if (edge == RectangleEdge.TOP)
    Differences
    Expression1Expression2Difference
    LEFTTOPVARIABLE_NAME_MISMATCH
    35
    if (edge == RectangleEdge.TOP)
    23
    angle = -Math.PI / 2.0;
    23
    angle = -Math.PI / 2.0;
    36
    angle = Math.PI / 2.0;
    Differences
    Expression1Expression2Difference
    -Math.PIMath.PITYPE_COMPATIBLE_REPLACEMENT
    36
    angle = Math.PI / 2.0;
    else
    else
    24
    angle = Math.PI / 2.0;
    24
    angle = Math.PI / 2.0;
    37
    angle = -Math.PI / 2.0;
    Differences
    Expression1Expression2Difference
    Math.PI-Math.PITYPE_COMPATIBLE_REPLACEMENT
    37
    angle = -Math.PI / 2.0;
    else
    else
    25
    if (edge == RectangleEdge.LEFT)
    25
    if (edge == RectangleEdge.LEFT)
    38
    if (edge == RectangleEdge.TOP)
    Differences
    Expression1Expression2Difference
    LEFTTOPVARIABLE_NAME_MISMATCH
    38
    if (edge == RectangleEdge.TOP)
    26
    anchor = TextAnchor.CENTER_RIGHT;
    26
    anchor = TextAnchor.CENTER_RIGHT;
    39
    anchor = TextAnchor.BOTTOM_CENTER;
    Differences
    Expression1Expression2Difference
    CENTER_RIGHTBOTTOM_CENTERVARIABLE_NAME_MISMATCH
    39
    anchor = TextAnchor.BOTTOM_CENTER;
    27
    rotationAnchor = TextAnchor.CENTER_RIGHT;
    27
    rotationAnchor = TextAnchor.CENTER_RIGHT;
    40
    rotationAnchor = TextAnchor.BOTTOM_CENTER;
    Differences
    Expression1Expression2Difference
    CENTER_RIGHTBOTTOM_CENTERVARIABLE_NAME_MISMATCH
    40
    rotationAnchor = TextAnchor.BOTTOM_CENTER;
    else
    else
    28
    anchor = TextAnchor.CENTER_LEFT;
    28
    anchor = TextAnchor.CENTER_LEFT;
    41
    anchor = TextAnchor.TOP_CENTER;
    Differences
    Expression1Expression2Difference
    CENTER_LEFTTOP_CENTERVARIABLE_NAME_MISMATCH
    41
    anchor = TextAnchor.TOP_CENTER;
    29
    rotationAnchor = TextAnchor.CENTER_LEFT;
    29
    rotationAnchor = TextAnchor.CENTER_LEFT;
    42
    rotationAnchor = TextAnchor.TOP_CENTER;
    Differences
    Expression1Expression2Difference
    CENTER_LEFTTOP_CENTERVARIABLE_NAME_MISMATCH
    42
    rotationAnchor = TextAnchor.TOP_CENTER;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables anchor, rotationAnchor, angle , while Clone fragment #2 returns variables anchor, rotationAnchor, angle