AxisLocation result = null;
if (index < this.rangeAxisLocations.size()) {
result = (AxisLocation) this.rangeAxisLocations.get(index);
}
if (result == null) {
result = AxisLocation.getOpposite(getRangeAxisLocation(0));
}
return result;
AxisLocation result = null;
if (index < this.rangeAxisLocations.size()) {
result = (AxisLocation) this.rangeAxisLocations.get(index);
}
if (result == null) {
result = AxisLocation.getOpposite(getRangeAxisLocation());
}
return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
|
Method name: AxisLocation getRangeAxisLocation(int)
|
|
Method name: AxisLocation getRangeAxisLocation(int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | AxisLocation result = null;↵ | | 1 | AxisLocation result = null;↵
|
2 | if (index < this.rangeAxisLocations.size()) {↵ | | 2 | if (index < this.rangeAxisLocations.size()) {↵
|
3 | result = (AxisLocation) this.rangeAxisLocations.get(index);↵ | | 3 | result = (AxisLocation) this.rangeAxisLocations.get(index);↵
|
4 | }↵ | | 4 | }↵
|
5 | if (result == null) {↵ | | 5 | if (result == null) {↵
|
6 | result = AxisLocation.getOpposite(getRangeAxisLocation(0));↵ | | 6 | result = AxisLocation.getOpposite(getRangeAxisLocation());↵
|
7 | }↵ | | 7 | }↵
|
8 | return result; | | 8 | return result;
|
See real code fragment |
|
See real code fragment |
Summary
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) | 0.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 5.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | AxisLocation result = null; | | 1 | AxisLocation result = null; |
2 | if (index < this.rangeAxisLocations.size()) | | 2 | if (index < this.rangeAxisLocations.size()) |
3 | result = (AxisLocation)this.rangeAxisLocations.get(index); | | 3 | result = (AxisLocation)this.rangeAxisLocations.get(index); |
4 | if (result == null) | | 4 | if (result == null) |
5 | result = AxisLocation.getOpposite(getRangeAxisLocation(0)); | | 5 | result = AxisLocation.getOpposite(getRangeAxisLocation()); |
6 | return result; | | 6 | return result; |
Precondition Violations (1)
Row |
Violation |
1 | Expression getRangeAxisLocation(0) is a method call throwing exception(s) that should be caught by a try block that will be extracted |