File path: /jfreechart-1.0.10/src/org/jfree/data/DefaultKeyedValues2D.java | File path: /jfreechart-1.0.10/src/org/jfree/data/KeyedObjects2D.java | |||
Method name: Number getValue(int, int)
|
Method name: Object getObject(int, int)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (rowData != null) {↵ | |||
2 | Comparable columnKey = (Comparable) this.columnKeys.get(column);↵ | 1 | Comparable columnKey = (Comparable) this.columnKeys.get(column);↵ | |
3 | // the row may not have an entry for this key, in which case the ↵ | 2 | ↵ | |
4 | // return value is null↵ | |||
3 | if (columnKey != null) {↵ | |||
5 | int index = rowData.getIndex(columnKey);↵ | 4 | int index = rowData.getIndex(columnKey);↵ | |
6 | if (index >= 0) {↵ | 5 | if (index >= 0) {↵ | |
7 | result = rowData.getValue(index);↵ | 6 | result = rowData.getObject(columnKey);↵ | |
8 | }↵ | 7 | ↵ | |
8 | }↵ | |||
9 | } | 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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 10 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 | Comparable columnKey = (Comparable)this.columnKeys.get(column); | |||||||||||||||||
3 | if (rowData != null) |
| 5 | if (columnKey != null) | |||||||||||||||
4 | Comparable columnKey = (Comparable)this.columnKeys.get(column); | | |||||||||||||||||
5 | int index = rowData.getIndex(columnKey); |
| 6 | int index = rowData.getIndex(columnKey); | |||||||||||||||
6 | if (index >= 0) | 7 | if (index >= 0) | ||||||||||||||||
7 | result = rowData.getValue(index); |
| | ||||||||||||||||
|
| 8 | result = rowData.getObject(columnKey); |
Row | Violation |
---|---|
1 | Expression columnKey cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Type org.jfree.data.DefaultKeyedValues of variable rowData does not match with type java.lang.Comparable of variable columnKey |
3 | Expression rowData cannot be unified with expression rowData , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getIndex(Comparable#RAW) |
4 | Unmatched statement result=rowData.getValue(index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement result=rowData.getValue(index); 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 |
6 | Unmatched statement result=rowData.getObject(columnKey); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched statement result=rowData.getObject(columnKey); 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 |
8 | Clone fragment #1 returns variables index , while Clone fragment #2 returns variables |