if (info == null) {
throw new IllegalArgumentException("Null 'info' argument.");
}
if (source == null) {
throw new IllegalArgumentException("Null 'source' argument.");
}
XYPlot result = null;
int subplotIndex = info.getSubplotIndex(source);
if (subplotIndex >= 0) {
result = (XYPlot) this.subplots.get(subplotIndex);
}
return result;
if (info == null) {
throw new IllegalArgumentException("Null 'info' argument.");
}
if (source == null) {
throw new IllegalArgumentException("Null 'source' argument.");
}
XYPlot result = null;
int subplotIndex = info.getSubplotIndex(source);
if (subplotIndex >= 0) {
result = (XYPlot) this.subplots.get(subplotIndex);
}
return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java
|
Method name: XYPlot findSubplot(PlotRenderingInfo, Point2D)
|
|
Method name: XYPlot findSubplot(PlotRenderingInfo, Point2D)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | if (info == null) {↵ | | 1 | if (info == null) {↵
|
2 | throw new IllegalArgumentException("Null 'info' argument.");↵ | | 2 | throw new IllegalArgumentException("Null 'info' argument.");↵
|
3 | }↵ | | 3 | }↵
|
4 | if (source == null) {↵ | | 4 | if (source == null) {↵
|
5 | throw new IllegalArgumentException("Null 'source' argument.");↵ | | 5 | throw new IllegalArgumentException("Null 'source' argument.");↵
|
6 | }↵ | | 6 | }↵
|
7 | XYPlot result = null;↵ | | 7 | XYPlot result = null;↵
|
8 | int subplotIndex = info.getSubplotIndex(source);↵ | | 8 | int subplotIndex = info.getSubplotIndex(source);↵
|
9 | if (subplotIndex >= 0) {↵ | | 9 | if (subplotIndex >= 0) {↵
|
10 | result = (XYPlot) this.subplots.get(subplotIndex);↵ | | 10 | result = (XYPlot) this.subplots.get(subplotIndex);↵
|
11 | }↵ | | 11 | }↵
|
12 | return result; | | 12 | 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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 30 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 9 |
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) | 2.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (info == null) | | 1 | if (info == null) |
2 | throw new IllegalArgumentException("Null 'info' argument."); | | 2 | throw new IllegalArgumentException("Null 'info' argument."); |
3 | if (source == null) | | 3 | if (source == null) |
4 | throw new IllegalArgumentException("Null 'source' argument."); | | 4 | throw new IllegalArgumentException("Null 'source' argument."); |
5 | XYPlot result = null; | | 5 | XYPlot result = null; |
6 | int subplotIndex = info.getSubplotIndex(source); | | 6 | int subplotIndex = info.getSubplotIndex(source); |
7 | if (subplotIndex >= 0) | | 7 | if (subplotIndex >= 0) |
8 | result = (XYPlot)this.subplots.get(subplotIndex); | | 8 | result = (XYPlot)this.subplots.get(subplotIndex); |
9 | return result; | | 9 | return result; |
Precondition Violations (0)
Row |
Violation |