File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAxis.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 | return new AxisState(cursor);↵ | 4 | state = new AxisState(cursor);↵ | |
3 | }↵ | 5 | ↵ | |
4 | if (isAxisLineVisible()) {↵ | |||
5 | drawAxisLine(g2, cursor, dataArea, edge)↵ | 6 | // even though the axis is not visible, we need ticks for the↵ | |
7 | // gridlines...↵ | |||
8 | List ticks = refreshTicks(g2, state, dataArea, edge);↵ | |||
9 | state.setTicks(ticks);↵ | |||
6 | ;↵ | 10 | return state;↵ | |
7 | }↵ | 11 | }↵ | |
8 | // draw the category labels and axis label↵ | 12 | // draw the ↵ | |
9 | AxisState state = new AxisState(cursor↵ | 13 | tick marks and labels...↵ | |
14 | state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);↵ | |||
15 | // // draw the marker band (if there is one)...↵ | |||
16 | // if (getMarkerBand() != null) {↵ | |||
17 | // if (edge == RectangleEdge.BOTTOM) {↵ | |||
10 | );↵ | 18 | // cursor = cursor - getMarkerBand().getHeight(g2);↵ | |
11 | state = drawCategoryLabels↵ | 19 | // }↵ | |
12 | (g2, plotArea, dataArea, edge, state,↵ | 20 | // getMarkerBand().draw(g2, plotArea, dataArea, ↵ | |
21 | 0, cursor);↵ | |||
13 | ↵ | 22 | // }↵ | |
14 | plotState);↵ | 23 | // draw the axis label...↵ | |
15 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);↵ | 24 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);↵ | |
16 | return state; | 25 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 24 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 39.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!isVisible()) | 2 | if (!isVisible()) | ||||||||||||||||||
|
| 3 | state = new AxisState(cursor); | ||||||||||||||||||
|
| 4 | List ticks = refreshTicks(g2, state, dataArea, edge); | ||||||||||||||||||
|
| 5 | state.setTicks(ticks); | ||||||||||||||||||
2 | return new AxisState(cursor); |
| 6 | return state; | |||||||||||||||||
5 | AxisState state = new AxisState(cursor); |
| 1 | AxisState state = null; | |||||||||||||||||
6 | state = drawCategoryLabels(g2, plotArea, dataArea, edge, state, plotState); |
| 7 | state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); | |||||||||||||||||
7 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); | 8 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); | ||||||||||||||||||
8 | return state; | 9 | return state; |
Row | Violation |
---|---|
1 | Unmatched statement state=new AxisState(cursor); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement List ticks=refreshTicks(g2,state,dataArea,edge); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement List ticks=refreshTicks(g2,state,dataArea,edge); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement state.setTicks(ticks); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Expression state cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression new AxisState(cursor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression drawCategoryLabels(g2,plotArea,dataArea,edge,state,plotState) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression drawCategoryLabels(g2,plotArea,dataArea,edge,state,plotState) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables state |