File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java | |||
Method name: List refreshTicksHorizontal(Graphics2D, Rectangle2D, RectangleEdge)
|
Method name: List refreshVerticalTicks(Graphics2D, Rectangle2D, RectangleEdge)
|
|||
Number of AST nodes: 17 | Number of AST nodes: 17 | |||
1 | if (edge == RectangleEdge.TOP) {↵ | 1 | if (edge == RectangleEdge.LEFT) {↵ | |
2 | anchor = TextAnchor.BOTTOM_CENTER; ↵ | 2 | anchor = TextAnchor.CENTER_RIGHT; ↵ | |
3 | if ((lastTick != null) && (lastX == x) ↵ | 3 | if ((lastTick != null) && (lastY == y) ↵ | |
4 | && (currentTickValue != cycleBound)) {↵ | 4 | && (currentTickValue != cycleBound)) {↵ | |
5 | anchor = isInverted() ↵ | 5 | anchor = isInverted() ↵ | |
6 | ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT;↵ | 6 | ? TextAnchor.BOTTOM_RIGHT : TextAnchor.TOP_RIGHT;↵ | |
7 | result.remove(result.size() - 1);↵ | 7 | result.remove(result.size() - 1);↵ | |
8 | result.add(new CycleBoundTick(↵ | 8 | result.add(new CycleBoundTick(↵ | |
9 | this.boundMappedToLastCycle, lastTick.getNumber(),↵ | 9 | this.boundMappedToLastCycle, lastTick.getNumber(),↵ | |
10 | lastTick.getText(), anchor, anchor, ↵ | 10 | lastTick.getText(), anchor, anchor, ↵ | |
11 | lastTick.getAngle())↵ | 11 | lastTick.getAngle())↵ | |
12 | );↵ | 12 | );↵ | |
13 | this.internalMarkerWhenTicksOverlap = true;↵ | 13 | this.internalMarkerWhenTicksOverlap = true;↵ | |
14 | anchor = isInverted() ↵ | 14 | anchor = isInverted() ↵ | |
15 | ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT;↵ | 15 | ? TextAnchor.TOP_RIGHT : TextAnchor.BOTTOM_RIGHT;↵ | |
16 | }↵ | 16 | }↵ | |
17 | rotationAnchor = anchor;↵ | 17 | rotationAnchor = anchor;↵ | |
18 | }↵ | 18 | }↵ | |
19 | else {↵ | 19 | else {↵ | |
20 | anchor = TextAnchor.TOP_CENTER; ↵ | 20 | anchor = TextAnchor.CENTER_LEFT; ↵ | |
21 | if ((lastTick != null) && (lastX == x) ↵ | 21 | if ((lastTick != null) && (lastY == y) ↵ | |
22 | && (currentTickValue != cycleBound)) {↵ | 22 | && (currentTickValue != cycleBound)) {↵ | |
23 | anchor = isInverted() ↵ | 23 | anchor = isInverted() ↵ | |
24 | ? TextAnchor.TOP_LEFT : TextAnchor.TOP_RIGHT;↵ | 24 | ? TextAnchor.BOTTOM_LEFT : TextAnchor.TOP_LEFT;↵ | |
25 | result.remove(result.size() - 1);↵ | 25 | result.remove(result.size() - 1);↵ | |
26 | result.add(new CycleBoundTick(↵ | 26 | result.add(new CycleBoundTick(↵ | |
27 | this.boundMappedToLastCycle, lastTick.getNumber(),↵ | 27 | this.boundMappedToLastCycle, lastTick.getNumber(),↵ | |
28 | lastTick.getText(), anchor, anchor, ↵ | 28 | lastTick.getText(), anchor, anchor, ↵ | |
29 | lastTick.getAngle())↵ | 29 | lastTick.getAngle())↵ | |
30 | );↵ | 30 | );↵ | |
31 | this.internalMarkerWhenTicksOverlap = true;↵ | 31 | this.internalMarkerWhenTicksOverlap = true;↵ | |
32 | anchor = isInverted() ↵ | 32 | anchor = isInverted() ↵ | |
33 | ? TextAnchor.TOP_RIGHT : TextAnchor.TOP_LEFT;↵ | 33 | ? TextAnchor.TOP_LEFT : TextAnchor.BOTTOM_LEFT;↵ | |
34 | }↵ | 34 | }↵ | |
35 | rotationAnchor = anchor;↵ | 35 | rotationAnchor = anchor;↵ | |
36 | } | 36 |
| |
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) | 3.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 131 |
Number of mapped statements | 17 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 39.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
45 | if (edge == RectangleEdge.TOP) |
| 54 | if (edge == RectangleEdge.LEFT) | ||||||||||||||||
46 | anchor = TextAnchor.BOTTOM_CENTER; |
| 63 | anchor = TextAnchor.CENTER_LEFT; | ||||||||||||||||
47 | if ((lastTick != null) && (lastX == x) && (currentTickValue != cycleBound)) |
| 64 | if ((lastTick != null) && (lastY == y) && (currentTickValue != cycleBound)) | ||||||||||||||||
48 | anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT; |
| 65 | anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.TOP_LEFT; | ||||||||||||||||
49 | result.remove(result.size() - 1); | 66 | result.remove(result.size() - 1); | |||||||||||||||||
50 | result.add(new CycleBoundTick(this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle())); |
| 67 | result.add(new CycleBoundTick(this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle())); | ||||||||||||||||
51 | this.internalMarkerWhenTicksOverlap = true; | 68 | this.internalMarkerWhenTicksOverlap = true; | |||||||||||||||||
52 | anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT; |
| 69 | anchor = isInverted() ? TextAnchor.TOP_LEFT : TextAnchor.BOTTOM_LEFT; | ||||||||||||||||
53 | rotationAnchor = anchor; | 70 | rotationAnchor = anchor; | |||||||||||||||||
else | else | |||||||||||||||||||
54 | anchor = TextAnchor.TOP_CENTER; |
| 55 | anchor = TextAnchor.CENTER_RIGHT; | ||||||||||||||||
55 | if ((lastTick != null) && (lastX == x) && (currentTickValue != cycleBound)) |
| 56 | if ((lastTick != null) && (lastY == y) && (currentTickValue != cycleBound)) | ||||||||||||||||
56 | anchor = isInverted() ? TextAnchor.TOP_LEFT : TextAnchor.TOP_RIGHT; |
| 57 | anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.TOP_RIGHT; | ||||||||||||||||
57 | result.remove(result.size() - 1); | 58 | result.remove(result.size() - 1); | |||||||||||||||||
58 | result.add(new CycleBoundTick(this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle())); |
| 59 | result.add(new CycleBoundTick(this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle())); | ||||||||||||||||
59 | this.internalMarkerWhenTicksOverlap = true; | 60 | this.internalMarkerWhenTicksOverlap = true; | |||||||||||||||||
60 | anchor = isInverted() ? TextAnchor.TOP_RIGHT : TextAnchor.TOP_LEFT; |
| 61 | anchor = isInverted() ? TextAnchor.TOP_RIGHT : TextAnchor.BOTTOM_RIGHT; | ||||||||||||||||
61 | rotationAnchor = anchor; | 62 | rotationAnchor = anchor; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables anchor, rotationAnchor , while Clone fragment #2 returns variables anchor, rotationAnchor |