if (!isVisible()) { AxisState state = new AxisState(cursor); // even though the axis is not visible, we need to refresh ticks in // case the grid is being drawn... List ticks = refreshTicks(g2, state, dataArea, edge); state.setTicks(ticks); return state; } // draw the tick marks and labels... AxisState state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); // draw the axis label (note that 'state' is passed in *and* // returned)... state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); return state;
AxisState state = null; // if the axis is not visible, don't draw it... if (!isVisible()) { state = new AxisState(cursor); // even though the axis is not visible, we need ticks for the // gridlines... List ticks = refreshTicks(g2, state, dataArea, edge); state.setTicks(ticks); return state; } // draw the tick marks and labels... state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); // // draw the marker band (if there is one)... // if (getMarkerBand() != null) { // if (edge == RectangleEdge.BOTTOM) { // cursor = cursor - getMarkerBand().getHeight(g2); // } // getMarkerBand().draw(g2, plotArea, dataArea, 0, cursor); // } // draw the axis label... state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); return state;
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/NumberAxis.java
Method name: AxisState draw(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge, PlotRenderingInfo) Method name: AxisState draw(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge, PlotRenderingInfo)
Number of AST nodes: 8 Number of AST nodes: 9
1
AxisState state = null;
2
        // if the axis is not visible, don't draw it...
1
if (!isVisible()) {
3
        if (!isVisible()) {
2
            AxisState state = new AxisState(cursor);
4
            state = new AxisState(cursor);
3
            // even though the axis is not visible, we need to refresh ticks in
5
            // even though the axis is not visible, we need ticks for the
4
            // case the grid is being drawn...
6
            // gridlines...
5
            List ticks = refreshTicks(g2, state, dataArea, edge);
7
            List ticks = refreshTicks(g2, state, dataArea, edge);
6
            state.setTicks(ticks);
8
            state.setTicks(ticks);
7
            return state;
9
            return state;
8
        }
10
        }
9
        // draw the tick marks and labels...
11
        // draw the tick marks and labels...
10
        AxisState state = drawTickMarksAndLabels(g2, cursor, plotArea,
12
        state = drawTickMarksAndLabels(g2, cursor, plotArea,
11
                dataArea, edge);
13
 dataArea, edge);
12
        // draw the axis label (note that 'state' is passed in *and*
14
//        // draw the 
13
        // returned)
15
marker band (if there is one)...
16
//        if (getMarkerBand() != null) {
17
//            if (edge == RectangleEdge.BOTTOM) {
18
//                cursor = cursor - getMarkerBand().getHeight(g2);
19
//            }
20
//            getMarkerBand().draw(g2, plotArea, dataArea, 0, cursor);
21
//        }
14
...
22
        // draw the axis label...
15
        state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);
23
        state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);
16
        return state;
24
        return state;
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)44.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                    
    1
    AxisState state = null;
    1
    if (!isVisible())
    2
    if (!isVisible())
    2
    AxisState state = new AxisState(cursor);
    3
    state = new AxisState(cursor);
    3
    List ticks = refreshTicks(g2, state, dataArea, edge);
    4
    List ticks = refreshTicks(g2, state, dataArea, edge);
    4
    state.setTicks(ticks);
    5
    state.setTicks(ticks);
    5
    return state;
    6
    return state;
    6
    AxisState state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);
    6
    AxisState state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);
    8
    state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);
    Differences
    Expression1Expression2Difference
    drawTickMarksAndLabelsdrawLabelMETHOD_INVOCATION_NAME_MISMATCH
    drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge)drawLabel(getLabel(),g2,plotArea,dataArea,edge,state)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);
    7
    state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);
    7
    state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);
    7
    state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);
    Differences
    Expression1Expression2Difference
    drawLabeldrawTickMarksAndLabelsMETHOD_INVOCATION_NAME_MISMATCH
    drawLabel(getLabel(),g2,plotArea,dataArea,edge,state)drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);
    8
    return state;
    9
    return state;
    Precondition Violations (8)
    Row Violation
    1Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted