File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/Plot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/Plot.java | |||
Method name: RectangleEdge resolveDomainAxisLocation(AxisLocation, PlotOrientation)
|
Method name: RectangleEdge resolveRangeAxisLocation(AxisLocation, PlotOrientation)
|
|||
Number of AST nodes: 28 | Number of AST nodes: 28 | |||
1 | if (location == null) {↵ | 1 | if (location == null) {↵ | |
2 | throw new IllegalArgumentException("Null 'location' argument.");↵ | 2 | throw new IllegalArgumentException("Null 'location' argument.");↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (orientation == null) {↵ | 4 | if (orientation == null) {↵ | |
5 | throw new IllegalArgumentException("Null 'orientation' argument.");↵ | 5 | throw new IllegalArgumentException("Null 'orientation' argument.");↵ | |
6 | }↵ | 6 | }↵ | |
7 | RectangleEdge result = null;↵ | 7 | RectangleEdge result = null;↵ | |
8 | if (location == AxisLocation.TOP_OR_RIGHT) {↵ | 8 | if (location == AxisLocation.TOP_OR_RIGHT) {↵ | |
9 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 9 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
10 | result = RectangleEdge.RIGHT;↵ | 10 | result = RectangleEdge.TOP;↵ | |
11 | }↵ | 11 | }↵ | |
12 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 12 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
13 | result = RectangleEdge.TOP;↵ | 13 | result = RectangleEdge.RIGHT;↵ | |
14 | }↵ | 14 | }↵ | |
15 | }↵ | 15 | }↵ | |
16 | else if (location == AxisLocation.TOP_OR_LEFT) {↵ | 16 | else if (location == AxisLocation.TOP_OR_LEFT) {↵ | |
17 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 17 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
18 | result = RectangleEdge.LEFT;↵ | 18 | result = RectangleEdge.TOP;↵ | |
19 | }↵ | 19 | }↵ | |
20 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 20 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
21 | result = RectangleEdge.TOP;↵ | 21 | result = RectangleEdge.LEFT;↵ | |
22 | }↵ | 22 | }↵ | |
23 | }↵ | 23 | }↵ | |
24 | else if (location == AxisLocation.BOTTOM_OR_RIGHT) {↵ | 24 | else if (location == AxisLocation.BOTTOM_OR_RIGHT) {↵ | |
25 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 25 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
26 | result = RectangleEdge.RIGHT;↵ | 26 | result = RectangleEdge.BOTTOM;↵ | |
27 | }↵ | 27 | }↵ | |
28 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 28 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
29 | result = RectangleEdge.BOTTOM;↵ | 29 | result = RectangleEdge.RIGHT;↵ | |
30 | }↵ | 30 | }↵ | |
31 | }↵ | 31 | }↵ | |
32 | else if (location == AxisLocation.BOTTOM_OR_LEFT) {↵ | 32 | else if (location == AxisLocation.BOTTOM_OR_LEFT) {↵ | |
33 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 33 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
34 | result = RectangleEdge.LEFT;↵ | 34 | result = RectangleEdge.BOTTOM;↵ | |
35 | }↵ | 35 | }↵ | |
36 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 36 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
37 | result = RectangleEdge.BOTTOM;↵ | 37 | result = RectangleEdge.LEFT;↵ | |
38 | }↵ | 38 | }↵ | |
39 | }↵ | 39 | }↵ | |
40 | // the above should cover all the options...↵ | 40 | // the above should cover all the options...↵ | |
41 | if (result == null) {↵ | 41 | if (result == null) {↵ | |
42 | throw new IllegalStateException("resolveDomainAxisLocation()");↵ | 42 | throw new IllegalStateException("resolveRangeAxisLocation()");↵ | |
43 | }↵ | 43 | }↵ | |
44 | return result; | 44 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 8.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 198 |
Number of mapped statements | 28 |
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) | 10.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (location == null) | 1 | if (location == null) | |||||||||||
2 | throw new IllegalArgumentException("Null 'location' argument."); | 2 | throw new IllegalArgumentException("Null 'location' argument."); | |||||||||||
3 | if (orientation == null) | 3 | if (orientation == null) | |||||||||||
4 | throw new IllegalArgumentException("Null 'orientation' argument."); | 4 | throw new IllegalArgumentException("Null 'orientation' argument."); | |||||||||||
5 | RectangleEdge result = null; | 5 | RectangleEdge result = null; | |||||||||||
6 | if (location == AxisLocation.TOP_OR_RIGHT) | 6 | if (location == AxisLocation.TOP_OR_RIGHT) | |||||||||||
7 | if (orientation == PlotOrientation.HORIZONTAL) | 7 | if (orientation == PlotOrientation.HORIZONTAL) | |||||||||||
8 | result = RectangleEdge.RIGHT; |
| 8 | result = RectangleEdge.TOP; | ||||||||||
9 | else if (orientation == PlotOrientation.VERTICAL) | 9 | else if (orientation == PlotOrientation.VERTICAL) | |||||||||||
10 | result = RectangleEdge.TOP; |
| 10 | result = RectangleEdge.RIGHT; | ||||||||||
11 | else if (location == AxisLocation.TOP_OR_LEFT) | 11 | else if (location == AxisLocation.TOP_OR_LEFT) | |||||||||||
12 | if (orientation == PlotOrientation.HORIZONTAL) | 12 | if (orientation == PlotOrientation.HORIZONTAL) | |||||||||||
13 | result = RectangleEdge.LEFT; |
| 13 | result = RectangleEdge.TOP; | ||||||||||
14 | else if (orientation == PlotOrientation.VERTICAL) | 14 | else if (orientation == PlotOrientation.VERTICAL) | |||||||||||
15 | result = RectangleEdge.TOP; |
| 15 | result = RectangleEdge.LEFT; | ||||||||||
16 | else if (location == AxisLocation.BOTTOM_OR_RIGHT) | 16 | else if (location == AxisLocation.BOTTOM_OR_RIGHT) | |||||||||||
17 | if (orientation == PlotOrientation.HORIZONTAL) | 17 | if (orientation == PlotOrientation.HORIZONTAL) | |||||||||||
18 | result = RectangleEdge.RIGHT; |
| 18 | result = RectangleEdge.BOTTOM; | ||||||||||
19 | else if (orientation == PlotOrientation.VERTICAL) | 19 | else if (orientation == PlotOrientation.VERTICAL) | |||||||||||
20 | result = RectangleEdge.BOTTOM; |
| 20 | result = RectangleEdge.RIGHT; | ||||||||||
21 | else if (location == AxisLocation.BOTTOM_OR_LEFT) | 21 | else if (location == AxisLocation.BOTTOM_OR_LEFT) | |||||||||||
22 | if (orientation == PlotOrientation.HORIZONTAL) | 22 | if (orientation == PlotOrientation.HORIZONTAL) | |||||||||||
23 | result = RectangleEdge.LEFT; |
| 23 | result = RectangleEdge.BOTTOM; | ||||||||||
24 | else if (orientation == PlotOrientation.VERTICAL) | 24 | else if (orientation == PlotOrientation.VERTICAL) | |||||||||||
25 | result = RectangleEdge.BOTTOM; |
| 25 | result = RectangleEdge.LEFT; | ||||||||||
26 | if (result == null) | 26 | if (result == null) | |||||||||||
27 | throw new IllegalStateException("resolveDomainAxisLocation()"); |
| 27 | throw new IllegalStateException("resolveRangeAxisLocation()"); | ||||||||||
28 | return result; | 28 | return result; |
Row | Violation |
---|