File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomPieURLGenerator.java | |||
Method name: int getDomainAxisIndex(ValueAxis)
|
Method name: String getURL(Comparable, int)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | int result = this.domainAxes.indexOf(axis);↵ | 1 | String result = ↵ | |
2 | if (result < 0) {↵ | |||
3 | // try the parent plot↵ | |||
4 | Plot parent = getParent();↵ | |||
5 | if (parent instanceof XYPlot) {↵ | |||
6 | XYPlot p = (XYPlot) parent;↵ | |||
7 | result = p.getDomainAxisIndex(axis↵ | 2 | null;↵ | |
3 | if (mapIndex < getListCount()) {↵ | |||
4 | Map urlMap = (Map) this.urls.get(mapIndex);↵ | |||
5 | if (urlMap != null) {↵ | |||
8 | );↵ | 6 | result = (String) urlMap.get(key);↵ | |
9 | }↵ | 7 | }↵ | |
10 | }↵ | 8 | }↵ | |
11 | return result; | 9 |
| |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 6 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | String result = null; | |||||||||||||||
1 | int result = this.domainAxes.indexOf(axis); | | |||||||||||||||
2 | if (result < 0) |
| 2 | if (mapIndex < getListCount()) | |||||||||||||
|
| 3 | Map urlMap = (Map)this.urls.get(mapIndex); | ||||||||||||||
3 | Plot parent = getParent(); | | |||||||||||||||
| 4 | if (urlMap != null) | |||||||||||||||
|
| 5 | result = (String)urlMap.get(key); | ||||||||||||||
4 | if (parent instanceof XYPlot) | | |||||||||||||||
5 | XYPlot p = (XYPlot)parent; | | |||||||||||||||
6 | result = p.getDomainAxisIndex(axis); |
| | ||||||||||||||
|
| 6 | return result; | ||||||||||||||
7 | return result; |
| |
Row | Violation |
---|---|
1 | Unmatched statement Map urlMap=(Map)this.urls.get(mapIndex); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement result=(String)urlMap.get(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement result=p.getDomainAxisIndex(axis); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return result; |
5 | Unmatched return result; |
6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |